简体   繁体   English

Power BI 数据 model 设计关系 - 直接活动关系会在表之间引入歧义

[英]Power BI data model design relationships - direct active relationship would introduce ambiguity between the tables

Can anyone offer some modeling & relationship advise in Power BI?任何人都可以在 Power BI 中提供一些建模和关系建议吗?

I have two Customer tables at different grains that I am trying to relate to a Customer rollup group ( 'dimCustomers' ).我有两个不同粒度的客户表,我试图将它们与客户汇总组( 'dimCustomers' )相关联。

The two customers tables ( 'dimBillTierCustomer' and 'dimCustomerMeter' ) are individually related to my fact table ( 'factSummaryTicket' ).两个客户表( 'dimBillTierCustomer''dimCustomerMeter' )分别与我的事实表( 'factSummaryTicket' )相关。 These two relationships work individually, but I want them to be aware of the relationship they each have to 'dimCustomers' , so I can use Customers to filter both tables in the report.这两个关系单独工作,但我希望他们了解他们各自与'dimCustomers'的关系,因此我可以使用 Customers 过滤报告中的两个表。

When I relate each of them, I get an error message on the second relationship.当我关联它们中的每一个时,我会收到关于第二个关系的错误消息。

You can't create a direct active relationship between 'dimCustomerMeter' and 'dimCustomers' because that would introduce ambiguity between the tables 'dimCustomers' and 'factSummaryTicket' .您不能在'dimCustomerMeter''dimCustomers'之间创建直接的活动关系,因为这会在表'dimCustomers''factSummaryTicket'之间引入歧义。 To make this relationship active, deactivate or delete one of the relationships between 'dimCustomers' and 'factSummaryTicket' first.要激活此关系,请先停用或删除“dimCustomers”“factSummaryTicket”之间的关系之一。

Screenshots below show sample data, table relations, and the error message.下面的屏幕截图显示了示例数据、表关系和错误消息。

Bill Tier is for Customer pricing rules. Bill Tier 适用于客户定价规则。 Customer Meter is customer locations hierarchy.客户仪表是客户位置层次结构。 Customer should filter both of these tables.客户应过滤这两个表。

Table Relations表关系

+------------------------------------------------------------------------------------------+----------------+-----------------+---------------+-----------+
| Relation   (From : To)                                                                   | CrossFiltering | FromCardinality | ToCardinality | IsActive  |
+------------------------------------------------------------------------------------------+----------------+-----------------+---------------+-----------+
| [gopherMeterId].[factSummaryTicket]     ==> : <==    [bisonMeterId].[dimCustomerMeter]   | OneDirection   | Many            | One           | TRUE      |
+------------------------------------------------------------------------------------------+----------------+-----------------+---------------+-----------+
| [CustBillTierKey].[factSummaryTicket]   ==> : <==    [CustTierKey].[dimBillTierCustomer] | OneDirection   | Many            | One           | TRUE      |
+------------------------------------------------------------------------------------------+----------------+-----------------+---------------+-----------+
| [eticketOperatorId].[dimCustomerMeter]  ==> : <==    [eticketOperatorId].[dimCustomers]  | OneDirection   | Many            | One           | **FALSE** |
+------------------------------------------------------------------------------------------+----------------+-----------------+---------------+-----------+
| [CustKey].[dimBillTierCustomer]         ==> : <==    [eticketOperatorId].[dimCustomers]  | OneDirection   | Many            | One           | TRUE      |
+------------------------------------------------------------------------------------------+----------------+-----------------+---------------+-----------+

Sample Data样本数据

在此处输入图像描述

Table Diagram表格图

在此处输入图像描述

One simple change gave me the functionality I needed.一项简单的更改为我提供了所需的功能。 Without having to relate 'dimCustomerMeter' and 'dimBillTierCustomer'.无需关联“dimCustomerMeter”和“dimBillTierCustomer”。 The solution was to enable 'Bi-Directional' instead of 'Single'.解决方案是启用“双向”而不是“单向”。

Bi Directional Relationship双向关系

在此处输入图像描述

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM