Forum Discussion

kunwar2's avatar
kunwar2
New Member
1 year ago

Help with SUMX DAX

I've been working on a Finance PVM (Price Volume Mix) Analysis in PowerBI and have been stuck with a SUMX DAX measure that doesn't return the intended value.
I have tried multiple way-outs and even brought the semantic model in a flat file to simplify things but still no resolution.

The model has Region and product hierarchies against which we have Sales, Units, and SGP for various scenarios. The visual has parameters that allow users to select scenarios selections (Actual/Forecast/Plan) which are then linked to measures.

And then there are a few calculated measures to calculate contributions of Sales and SGP of each SKU to total Sales and there are deltas between scenarios to calculate Mix.
The product of Sales Contribution Delta and SGP contribution Delta gives a Mix Factor, which is then multiplied by Total Sales to give Mix $.

This Mix$ is the right value when I see it at the lowest level of the product hierarchy; however, as soon as I use SUMX to achieve Mix$ for level 2 of the product hierarchy it does not sum and gives methe  wrong value or zero.

I can share some files if you could help with this.
I've been stuck with this for far too long.

Any help would be appreciated.

1 Reply

  • kunwar2 , Not very clear. But make sure you measure is like

     

    Sumx(Summarize(Fact, Dim[Col], Dim2[Col]), [Measure1]*[Measure2])

     

    In it from two fact and across different dimesions 

     

    Sumx(Values(Dim[Col]), calculate(Sumx(Values(Dim2[Col]), [Measure1]*[Measure2]) ) )

     

    You can use isinscope to change calculation for different level

    example

    How to Switch Subtotal and Grand Total in Power BI | Power BI Tutorials| isinscope: https://youtu.be/smhIPw3OkKA