Forum Discussion

jimrosser's avatar
jimrosser
Icon for Helper III rankHelper III
1 year ago
Solved

If Measure between two measures not summing properly

Hi I need help, it seems to be reacting the right way in the columns but the Column totals aren't summing correctly. It more or less should read if one variable is zero then take the other but. PR...
  • Deku's avatar
    1 year ago

    Coalesce (

    [PROJECTED_SALES_Rev],

    [Bud_Sales_Rev_ALL]

    )

    Coalesce returns the first nonblank result from the supplied parameters

     

    If you expect 0 rather than blank

     

    Switch (

    True,

    [PROJECTED_SALES_Rev] > 0, [PROJECTED_SALES_Rev],

    [Bud_Sales_Rev_ALL] > 0, [Bud_Sales_Rev_ALL]

    )

     

    Since you as checking this per rows ina table you might have to use sumx.

     

    Sumx(

    Values( table[column]),

    Switch (

    True,

    [PROJECTED_SALES_Rev] > 0, [PROJECTED_SALES_Rev],

    [Bud_Sales_Rev_ALL] > 0, [Bud_Sales_Rev_ALL]

    )

    )