Forum Discussion
Calculate Measure base on filter selection
- 6 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Filters:
Calculated tables:
P1 = DISTINCT('Filters'[P1]) P2 = DISTINCT('Filters'[P2]) P3 = DISTINCT('Filters'[P3]) P4 = DISTINCT('Filters'[P4])Table:
There is no relationship between tables. You may create a measure as below.
Count = COUNTROWS( FILTER( DISTINCT(P1[P1]), [P1]=SELECTEDVALUE('Table'[Colors]) ) )+ COUNTROWS( FILTER( DISTINCT(P2[P2]), [P2]=SELECTEDVALUE('Table'[Colors]) ) )+ COUNTROWS( FILTER( DISTINCT(P3[P3]), [P3]=SELECTEDVALUE('Table'[Colors]) ) )+ COUNTROWS( FILTER( DISTINCT(P4[P4]), [P4]=SELECTEDVALUE('Table'[Colors]) ) )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.
Hi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Filters:
Calculated tables:
P1 = DISTINCT('Filters'[P1])
P2 = DISTINCT('Filters'[P2])
P3 = DISTINCT('Filters'[P3])
P4 = DISTINCT('Filters'[P4])
Table:
There is no relationship between tables. You may create a measure as below.
Count =
COUNTROWS(
FILTER(
DISTINCT(P1[P1]),
[P1]=SELECTEDVALUE('Table'[Colors])
)
)+
COUNTROWS(
FILTER(
DISTINCT(P2[P2]),
[P2]=SELECTEDVALUE('Table'[Colors])
)
)+
COUNTROWS(
FILTER(
DISTINCT(P3[P3]),
[P3]=SELECTEDVALUE('Table'[Colors])
)
)+
COUNTROWS(
FILTER(
DISTINCT(P4[P4]),
[P4]=SELECTEDVALUE('Table'[Colors])
)
)
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.