Forum Discussion

PatrickByGecko's avatar
8 months ago
Solved

cumulative suite through time

Hi everybody,

Underneath I have a suite of quantities each month, I mean => 4,3,2,1 etc.. .

I would like to get the cumulative suite of theses quantities, I mean => 4, 7, 9, 10 etc..

How can I do that?

Thank you for your help.

 

 

  • Hi,

    One of ways to achieve this is to use visual calculation.

    I tried to create a sample pbix file like below, and please check the below image and the attached pbix file.

     

     

  • Hi PatrickByGecko ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.

8 Replies

  • Hi PatrickByGecko,

     

    You can create a cumulative total using a DAX measure. Here's a option you can try out:

    Cumulative Quantity = 
    CALCULATE(
        SUM('YourTable'[Quantity]),
        FILTER(
            ALLSELECTED('YourTable'[Date]),
            'YourTable'[Date] <= MAX('YourTable'[Date])
        )
    )

    If you're using a Date table (recommended):

    Cumulative Quantity = 
    CALCULATE(
        SUM('YourTable'[Quantity]),
        FILTER(
            ALLSELECTED('DateTable'[Date]),
            'DateTable'[Date] <= MAX('DateTable'[Date])
        )
    )

     

    Best regards!

    PS: If you find this post helpful consider leaving kudos or mark it as solution

  • Hi,

    One of ways to achieve this is to use visual calculation.

    I tried to create a sample pbix file like below, and please check the below image and the attached pbix file.

     

     

  • Hi PatrickByGecko 

    To achieve a cumulative sequence like 4 → 7 → 9 → 10 from monthly quantities, you do not need TOTALYTD unless you are working with a date hierarchy and want Year-To-Date totals. For a simple cumulative sum across months
     
    If your Date table has a proper Date column:
     
    CumulativeQty_YTD =
    TOTALYTD(
        SUM('YourTable'[Quantity]),
        'Date'[Date]
    ) 

     

    If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.

    Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.

  • Hi, if you want to have cumulative over time in total try below:

    Cumulative Quantity =
    VAR CurrentDate =
        MAX ( 'Calendar'[Date] )
    RETURN
    CALCULATE (
        [Quantity],
        FILTER (
            ALL ( 'Calendar'[Date] ),
            'Calendar'[Date] <= CurrentDate
        )
    )

     If you want it to be reset each year then below:

    Cumulative Quantity YTD =
    TOTALYTD(
        [Quantity],
        'Calendar'[Date]
    ) 
  • Hi,

    If you want the accumulation to start from January, then try this measure

    Measure = calculate([Total],datesytd(calendar[Date]))

    Hope this helps.

  • v-venuppu's avatar
    v-venuppu
    Community Support

    Hi PatrickByGecko ,

    May I ask if you have resolved this issue? Please let us know if you have any further issues, we are happy to help.

    Thank you.

  • Hi, thank you to you all for your help, and sorry for this delay of answer but I went a big sick...