Forum Discussion
Data Model - switch relation from inactive to active by condition.
In this case I just simplified my tables.
In reality I've 2 fact tables contain 500K Rows Each and I want to add filter which filter both.
Thank you Greg for your kindness
Idan
Hi Anonymous
You may set the relationships as inactive. Then create the measures with USERELATIONSHIP Function. For example:
Index1 = CALCULATE(SUM(Table1[index]),USERELATIONSHIP(Table1[index],'filter'[index]))
Index2 = CALCULATE(SUM(Table2[index]),USERELATIONSHIP('filter'[index],Table2[index]))
Attached the sample file for your reference. Below are some articles for you. Please understand that this link is provided “AS IS” with no warranties or guarantees of content changes, and confers no rights.
Regards,
Cherie
- Anonymous7 years agoNot applicable
Hi Cherie,
Tks for your quick respond :)The solution not solved all the issue.
When I am choosing filter category from filter Table then Table 3 not respond.Idan
- v-cherch-msft7 years agoMicrosoft Employee
Hi Anonymous
You may use the same way as below: 1. Add relationship between filter and table3 2.Create a measure Score1
Score1 = CALCULATE(SUM(Table3[score]),USERELATIONSHIP('filter'[category],Table3[category]))Regards,
Cherie
- Anonymous7 years agoNot applicable
Hi Cherie,
I tried to apply this method on real data and it doesn't work.
I upload my real data file contain only relevant information.Pls take as show in real data sheet - link
Hope for your respond.
Tks,
Idan