Forum Discussion
Model ambiguity workaround advice
- 5 years ago
Hi, Anonymous
Cross filtering both directions works well for a star shema like below.
While cross filtering direction does not work well as below with loops.
The above model can create an ambiguous set of relationships. For instance, if you sum up a field from TableX and then choose to filter by a field on TableY, then it’s not clear how the filter should travel, through the top table or the bottom table. For further information, you may refer to the document .
If the relationships are all active In your model, when you sum up a field from 'Transcation' and then choose to filter by a field on Date. Then it is not clear how the filter should travel, through 'Date'=>'Transcation' or 'Date'=>'Merchant'=>'Transcation'.
You may make the relationship between 'Date' and 'Merchant' inactive. Then you can use USERELATIONSHIP to get the result according to the slicer.
Here is a example about 'USERELATIONSHIP'. The pbix file is attached in the end.
Table:
Calendar:There are two inactive relationships between two tables.
Then you can create measures to calculate the sum of 'Val' filter by 'Calendar[Date]' use filter 'CalendarDate'=>'Table[Date1]' or 'CalendarDate'=>'Table[Date2]'.
Measure1 = CALCULATE( SUM('Table'[Val]), USERELATIONSHIP('Table'[Date1],'Calendar'[Date]) )Measure2 = CALCULATE( SUM('Table'[Val]), USERELATIONSHIP('Table'[Date2],'Calendar'[Date]) )Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous , In this case as the Transaction table, is the fact. Remove the relation between Merchant and date or make it inactive.
When you make that active using userelationship(merchant and date) also use crossfilter to remove relation between (transaction and date)
Thanks for the response amitchandak .
I can make the Merchant / Date relationship inactive, sure. Though, I'm a bit perplexed as to how implement the USERELATIONSHIP function.
The scenario would be creating a Slicer, using 'Date'[Date], to filter 'Merchant'[Registration Date].
Thanks