Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

How to convert SQL power function case statement to dax

1 - POWER (1-(case
when (COALESCE(sum(ABC),0) - COALESCE(sum(ABCD),0)) < 0 then 0
else (COALESCE(sum(ABC),0) - COALESCE(sum(ABCD),0)) / sum(XYZ) end),12)

  • Anonymous  Please Try below Code

    Measure=
    VAR ABC = (COALESCE(COALESCE(sum(ABC),0)-COALESCE(sum(ABCD),0)
    VAR XYZ = DIVIDE(ABC , sum(XYZ) )
    VAR Power = 1-IF(ABC<0,0,XYZ)
    RETURN
    POWER(Power,12)

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

1 Reply

  • Anonymous  Please Try below Code

    Measure=
    VAR ABC = (COALESCE(COALESCE(sum(ABC),0)-COALESCE(sum(ABCD),0)
    VAR XYZ = DIVIDE(ABC , sum(XYZ) )
    VAR Power = 1-IF(ABC<0,0,XYZ)
    RETURN
    POWER(Power,12)

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