我需要将日期表与来自不同表的多个字段链接起来,这些字段也必须相互链接。
3个数据源:
要链接到的日期表:
里程碑表(在“关闭日期”字段中) 批准的储蓄(按“批准日期”字段)
此外,“里程碑”表还具有另一个“日期”字段,稍后我也需要将其链接。但是,我不能将日期表与多个字段链接起来。
答案 0 :(得分:0)
您不能从两个相关的来源对表中的列进行切片。关系被设计为懒惰的,因此当您从关系的“一个”方面中获取一个值时,关系的“许多”方面就会随之而来。
User removed May from our 'One' Date table on the column Month, so let's remove all May dates from our 'Many' Approved Savings table.
关系的另一种可接受的用法是将第二个关系引入到“批准的储蓄”表的同一“许多”列,但来自不同的“一个”表。 (在本例中为里程碑)
User removed May from our 'One' Date table on the column Month, so let's remove all May dates from our 'Many' Approved Savings table. User also chose Mile Stone 445 from the 'One' Milestones table, so let's remove everything but May 2nd from the Date Column on the 'Many' Approved Savings table.
或者
User removed June from our 'One' Date table on the column Month, so let's remove all June dates from our 'Many' Approved Savings table. User also chose Mile Stone 999 from the 'One' Milestones table, so let's remove everything but December 29th from the Date Column on the 'Many' Approved Savings table.
在第二种情况下,显然“批准的储蓄”表将被过滤为无行,但它仍然是有效的配置。毕竟,您告诉它进行这种过滤,所以它只是在做它的工作。
但是,在您的情况下,当PowerBI Engine解释您的关系时,您引入了“歧义”。
User removed June from our 'One' date table on the column Month, so let's remove all June dates from our 'Many' Approved Savings table AND our 'Many' Milestones table . User also chose Mile Stone 999 from the 'One' Milestones but it doesn't exist because of the Previous relationship.
或者
The 'One' date table attempts to filter both Milestones and Approved Savings. Date table is sliced to contain set X of dates. Milestones translates that set of X dates in to set of Y Milestones records. Now Approved Savings has Milestones attempting to filter with set Y and the Date table attempting to filter with set X. These are potentially conflicting sets of dates and PowerBI doesn't know which set is valid.
如果删除了“日期表”->“批准的储蓄”关系,则会看到两件事:
在任何情况下,仍然可以通过在度量中使用USERELATIONSHIP来触发不活动的关系。我会提醒您不要使用它,IMO的使用表明存在麻烦或潜在设计不良的数据模型。