Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
Alice08
Helper III
Helper III

I want to show cumulative sum in the chart

I have data as below - 

 

Alice08_0-1736407797477.png

 

i want to create a logic which will show cumulative sum like below

Jan - 30

Feb - Jan + 20

Mar - Jan +Feb+ 50

Apr - Jan +Feb + Mar +20

6 REPLIES 6
v-yaningy-msft
Community Support
Community Support

Hi, @Alice08 

Thanks for the reply from @PijushRoy@suparnababu8 and @ryan_mayu. You can refer to their methods or try using following dax to achieve your need.

vyaningymsft_0-1737533101776.png

 

Cumulative Value = 
VAR _year = SELECTEDVALUE('Table'[Year])
VAR _re = 
CALCULATE(
    SUM('Table'[Value]),
    FILTER(
        ALLSELECTED('Table'),
        'Table'[Year] = _year &&
        'Table'[Month] <= MAX('Table'[Month])
    )
)
RETURN
_re

 

 

Best Regards,
Yang

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

PijushRoy
Super User
Super User

Hi @Alice08 
Please find the solution below.
For example, the fiscal year start date is 1st April. In my solution no data for Jan Feb March, so as cumulative showing total number
The calendar table is marked as Date Table in the model
Please change the dax as per your data model. 

PijushRoy_0-1736415089976.png

 

 

CumulativeSales = 
VAR SelectedDate = MAX('Calendar'[Date])
VAR FiscalYearStart = DATE(YEAR(SelectedDate) - IF(MONTH(SelectedDate) < 4, 1, 0), 4, 1)
VAR YTD_Calculation =
    CALCULATE(
        SUM(Sales_Invoice[Invoice Value]), 
        FILTER(
            ALL('Calendar'),
            'Calendar'[Date] >= FiscalYearStart && 'Calendar'[Date] <= SelectedDate
        )
    )
RETURN
    YTD_Calculation

 

 

 

Please let me know




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!





suparnababu8
Super User
Super User

Hi @Alice08 

 

you can use 

RUNNINGSUM 

DAX to achieve your requirment. 

 

Thanks

ryan_mayu
Super User
Super User

could you pls provide some sample data?





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Alice08_0-1736414141615.png

Sample data

 

you don't have the date column in your data? It's better to have a date column

 

then create a column

 

Column = sumx(FILTER('Table','Table'[Year]=EARLIER('Table'[Year])&&'Table'[date]<=EARLIER('Table'[date])),'Table'[Value])
 
11.PNG




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

Check out the February 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

Find out what's new and trending in the Fabric community.