Forum Discussion

AkshayManke's avatar
AkshayManke
Helper II
4 years ago
Solved

Calculating Two Values and Comparing with If Condition

Hi Everyone,    I have the below table.  Project Activity Name Status Project A Activity A Complete Project B Activity A On Hold Project C Activity A Complete Project D A...
  • Anonymous's avatar
    Anonymous
    4 years ago

    Hi AkshayManke ,

     

    Do you want to calculate the count of Completed Project Name ? I think you can add number type 1 in [Completed Projects 1] measure directly and then create a new measure based on it.

    Completed Projects 1 = 
    VAR _STATUS_LIST =
        CALCULATETABLE (
            VALUES ( 'Project'[Status] ),
            ALLEXCEPT ( 'Project', 'Project'[Project Name] )
        )
    VAR _COUNT =
        COUNTAX ( _STATUS_LIST, [Status] )
    RETURN
        IF ( AND ( "Complete" IN _STATUS_LIST, _COUNT = 1 ), 1 )
    Count of Complete =
    SUMX ( VALUES ( Project[Project Name] ), [Completed Projects 1] )

    Result is as below.

     

    Best Regards,
    Rico Zhou

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.