Forum Discussion

Cakos's avatar
Cakos
Frequent Visitor
6 years ago

Cumulation other months

Hey everyone,

 

how can I cumulate the single values in my example over months in that way:

 

Monthsingle valueaccumulated value
January1,091,09 
February1,452,54 
March1,33,84
April2,15,94

 

Many thanks!

 

19 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable
    It depends on many things. We don't even know if you're talking about a calculated column or a measure... To be able to accumulate values, you have to have a field that will tell how your entities are ordered. Here your entities are months but they could be anything...

    Bset
    D
    • Cakos's avatar
      Cakos
      Frequent Visitor

      Hey Anonymous ,

       

      thx for your reply.

       

      I try to put my request into concrete terms:

       

      The column "month" in my example comes from a Date table (Calender with hierarchy) in my model.

      "Single value" is a calculated measure.

       

      Do you need more information?

       

      Many thanks!

      • Anonymous's avatar
        Anonymous
        Not applicable
        // Base measure of which the accumulated value
        // is a variation.
        [Base Value] = SUM( FactTable[Value] )
        
        [Accumulated Value] =
        var __lastVisibleDate = max( Calendar[Date] )
        var __result =
        	calculate(
        		[Base Measure],
        		Calendar[Date] <= __lastVisibleDate,
        		allselected( Calendar[Date] )
        	)
        return
        	__result

         

        Best

        D