Forum Discussion

vidheesha's avatar
vidheesha
New Member
4 years ago
Solved

Stuck with the sum and if

Hi All,   I am trying to replicate the SQL case when statement in the Power BI as a calculated measure. The SQL statement is    (CASE WHEN 'Target Flag' = 'Actual' AND 'Date.FYear' = '2023' THE...
  • v-yalanwu-msft's avatar
    3 years ago

    Hi, vidheesha ;

    Try it.

    measure =
    IF (
        MAX ( [Target Flag] ) = "Actual"
            && MAX ( [Date.FYear] ) = 2023,
        SUM ( [X.var] ),
        0
    )
    


    Best Regards,
    Community Support Team _ Yalan Wu
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.