Forum Discussion

o59393's avatar
o59393
Icon for Post Prodigy rankPost Prodigy
3 years ago

Incorrect total with dax measure

Hi all

 

I need to get the sum product of a column multiplied by a percentage. 

 

My dax measure called Demand by bottler (Year +2) should calculate the demand by location multiplied by the growth %.

 

Below it should do the sum product of :

144,272,773 * 8.4% +

130,889,871 * 1.09% +

60,227,857* 7.08% +

18,453,746 * 15.98% 

 

 

 

The dax I use is:

 

Demand by bottler (Year +2) = 

SUMX ( 
   VALUES ( 'SKU by line - Official'),
   SUM(
       'SKU by line - Official'[Demand by bottler]) *
       CALCULATE(1+MAX('Demand incremental - Simulation'[Year +1 (Growth %)]))
) 

 

How ever the result is giving me over 1 trillion, but should be around 380 million.

 

How can I get right the dax?

 

Thanks.

1 Reply

  • mlsx4's avatar
    mlsx4
    Icon for Memorable Member rankMemorable Member

    Hi o59393 

     

    I don't know how are your measures defined, but what I have done is this:

     

     

    Demand by bottler (Year +2) = 
    
    SUMX ( 
       VALUES ( MyTable[Demand by bottler]),
        MyTable[Demand by bottler]+ (MyTable[Demand by bottler]* SUM(MyTable[Max of Year +1 (Growth %)]))
    )