Forum Discussion

PM_2078's avatar
PM_2078
New Member
2 years ago
Solved

Using IF statement in DAX

Hello, having an issue trying to figure this out.  I am trying to recreate an IF statement in Power BI using DAX.  I have the IF measure created, but not exactly sure how to SUM the result of the IF ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi PM_2078 

     

    As I understand it, your "Total Store A Volume" and "Total Store B Volume" are two measures. Here is my trying.

     

    Total Store A Volume and Total Store B Volume:

    Total Store A Volume = SUM([Store A Volume])

     

    Total Store B Volume = SUM([Store B Volume])

     

    Then I created a measure as follows.

    Revised Volume Total = 
    SUMX(
        'Table', 
        IF(
            [Total Store B Volume] < [Total Store A Volume], 
            [Total Store B Volume], 
            [Total Store A Volume]
        )
    )

     

    Result:

     

    Best Regards,
    Yulia Xu

     

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