Forum Discussion

Angel's avatar
Angel
Resolver III
6 years ago
Solved

Difference betweeen two cummulative values

Hi, everyone   I have been struggled with the phormula to get a difference between two cummulative values and I'm stuck. I want to show in a card the difference between two cummulative values depen...
  • Angel's avatar
    Angel
    6 years ago

    Hi, Anonymous , Anonymous 

     

    First of all, thanks for the quick responses. It have been useful. 

     

    Anonymous. I tried phormula you said and it shows an error. I think it's because Cummulative Quantity is a measure in the model, instead of a colum.

     

     

     

     

     

    Anonymous. The phormula you said works, except for the phormula to calculate 'Cumul Qty'. 

    So, I have changed phormula por Cumul Qty and it works.

     

     

    Cummulative Quantity = 
    
    CALCULATE(SUM(Sales[Quantity]);FILTER(ALL('Calendar'); 'Calendar'[Date] <= MAXX('Calendar';'Calendar'[Date])))

     

     

     

    Diff = 
    	[Cummulative Quantity]
    	- CALCULATE(
    		[Cummulative Quantity];
    		FIRSTDATE( 'Calendar'[Date] )
    	)

     

     

    And it works.....

     

    Thanks