Forum Discussion

jenneferparr's avatar
jenneferparr
Icon for Helper I rankHelper I
6 years ago
Solved

If-Then Measure doesn't total correctly

I have a table where I've created 3 measures to calculate a 4th measure using an if statement. I have two problems but specifically need help getting that if statement to total correctly. Here are m...
  • v-xicai's avatar
    v-xicai
    6 years ago

    Hi jenneferparr ,

     

    You may create a new measure like DAX below, assuming the field in Rows box of Matrix visual is Table1[Product ID].

     

    CALCBF_New =
    VAR _table =
        SUMMARIZE ( Table1, Table1[Product ID], "_Value", [CALCBF] )
    RETURN
        IF ( HASONEVALUE ( Table1[Product ID] ), [CALCBF], SUMX ( _table, [_Value] ) )
    

    Best Regards,

    Amy 

     

    Community Support Team _ Amy

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