Forum Discussion

Fistachpl's avatar
Fistachpl
Icon for Helper III rankHelper III
2 years ago
Solved

Cumulative sales

Hello I need to calculate the cumulative sales On the page I have filters apllied and I just need to calculate the mesaure Sold CY but do it in a cumulative way.   First column is a month ...
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi, Fistachpl 

    I create a sample table:

    First, create a new column to show month number:

    MonthNumber = MONTH('Table'[Date])

     

    Then create a new measure and try to use the following dax:

    Cumulative Sales = 
    CALCULATE(
        SUM('Table'[Sales]),
        FILTER(
            ALLSELECTED('Table'),
            'Table'[MonthNumber] <= MAX('Table'[MonthNumber])
        )
    )

     

    Put this measure in table visual, here is my preview:

     

    How to Get Your Question Answered Quickly 

    Best Regards

    Yongkang Hua

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.