Forum Discussion
Row context measure
- 7 years ago
HI Anonymous ,
Based on my understand, In your scenario, the CPI of Project 2 and 3 are less than 0.5, then the result will be 2.
You can use the following DAX query:
Measure = VAR a = ADDCOLUMNS ( VALUES ( Component[Project] ), "CPIa", [CPI] ) RETURN COUNTROWS ( FILTER ( a, [CPIa] < 0.5 && Component[Project] <> BLANK () ) )The measure you shared will not get the true data, the [CPI] is a measure, it will be calculated based on the filter, but in the measure "BAD Project", it will not have the context of Project names.
Best Regards,
Teige
Thanks, TeigeGao for the replay
Problem is by calculating the number of BAD projects.
The measure
BAD Project = CALCULATE(DISTINCTCOUNT(Component[Project]);FILTER(Component;[CPI]<0,5))Doesn't work it brings all projects
HI Anonymous ,
Based on my understand, In your scenario, the CPI of Project 2 and 3 are less than 0.5, then the result will be 2.
You can use the following DAX query:
Measure =
VAR a =
ADDCOLUMNS ( VALUES ( Component[Project] ), "CPIa", [CPI] )
RETURN
COUNTROWS ( FILTER ( a, [CPIa] < 0.5 && Component[Project] <> BLANK () ) )The measure you shared will not get the true data, the [CPI] is a measure, it will be calculated based on the filter, but in the measure "BAD Project", it will not have the context of Project names.
Best Regards,
Teige
- Anonymous7 years agoNot applicable
Thanks, TeigeGao it worked!