Forum Discussion
How to create measures that function across multiple columns
- 5 years ago
Hi, Anonymous
I am sorry for the late reply. Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may go to Power Query=>click 'Transform'=>make 'C1'-'C6' selected=>click 'Unpivot Columns'.
Then you may create two measures as below.
Criteria Met = COALESCE( DIVIDE( COUNTROWS( FILTER( 'Table', [Value]="CM" ) ), COUNTROWS( 'Table' ) ), 0 )Criteria Not Met = COALESCE( DIVIDE( COUNTROWS( FILTER( 'Table', [Value]="CNM" ) ), COUNTROWS( 'Table' ) ),0 )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
I am sorry for the late reply. Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Table:
You may go to Power Query=>click 'Transform'=>make 'C1'-'C6' selected=>click 'Unpivot Columns'.
Then you may create two measures as below.
Criteria Met =
COALESCE(
DIVIDE(
COUNTROWS(
FILTER(
'Table',
[Value]="CM"
)
),
COUNTROWS(
'Table'
)
),
0
)
Criteria Not Met =
COALESCE(
DIVIDE(
COUNTROWS(
FILTER(
'Table',
[Value]="CNM"
)
),
COUNTROWS(
'Table'
)
),0
)
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.