Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Row context measure

Hello everyone,   Need some help. I have Project KPI board. Everything was fine till that point, where I had to calculate how much Bad projects are? I think it's because Status measure I calculat...
  • TeigeGao's avatar
    TeigeGao
    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