power bi数据分析_Power BI数据模型:使用关系

本文探讨了如何在Power BI数据模型中创建不同类型的关系,以实现数据的规范化和完整性。通过与SQL Server连接,导入数据集,并在Power BI中管理关系,确保数据的正确关联,从而提高数据分析的准确性。
摘要由CSDN通过智能技术生成

power bi数据分析

In this article, we look at how to create different types of relationships between two or more tables in the Power BI data model.

在本文中,我们研究如何在Power BI数据模型中的两个或多个表之间创建不同类型的关系。

Anyone who has worked with a relational database management system knows that tables are related to each other via foreign key constraints. Table relationships are implemented to normalize the database, which is crucial to data integrity and avoids data duplication.

使用关系数据库管理系统的任何人都知道表是通过外键约束相互关联的。 表关系的实现是为了规范化数据库,这对数据完整性至关重要,并且避免了数据重复。

There are four main types of relationships between database tables: One to Many, Many to One, Many to Many, and One to One. A full explanation of these types is beyond the scope of this article. See Learn SQL: Types of relations article for a full explanation.

数据库表之间的关系主要有四种类型:一对多,多对一,多对多和一对一。 这些类型的完整说明超出了本文的范围。 有关完整说明,请参见学习SQL:关系类型一文。

创建一个虚拟数据集 (Creating a dummy dataset)

In this section, a dummy dataset will be created in SQL Server. In the next section, you will see how to connect Power BI with SQL Server and then import the dummy dataset into Power BI. We will create a simple database for a fictional book store. The name of the database will be the BookStore.

在本节中,将在SQL Server中创建一个虚拟数据集。 在下一节中,您将看到如何将Power BI与SQL Server连接,然后将虚拟数据集导入Power BI。 我们将为一个虚构的书店创建一个简单的数据库。 数据库的名称将为BookStore。

For details of creating a dummy dataset, please refer to the ‘Creating A Dummy Database’ section of SQL JOIN TABLES: Working with Queries in SQL Server

有关创建虚拟数据集的详细信息,请参考SQL JOIN TABLES:在SQL Server中使用查询的“创建虚拟数据库”部分。

将自动检测关系设置为False (Setting Autodetect Relationships to False)

By default, depending upon the column names of the table, Power BI may assume relationships between different tables by default. We do not want that.

默认情况下,根据表的列名,默认情况下,Power BI可能会假定不同表之间的关系。 我们不想要那样。

To disable this option, on Power BI Desktop, go to “File -> Options & Settings

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值