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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Bokbob
Helper I
Helper I

DAX for cumulative running totals based on date picker

Hi I have a DAX to calculate cumulative last 12 months and 24 months income.

sample of 2  DAX i used are..

 

Cumulative  $3000 - $5000:=
CALCULATE (
    [Donors $3000 - $5000],
    FILTER ( ALL ( 'Date'[DateAlt] ), 'Date'[DateAlt] <= MAX ( 'Date'[DateAlt] ) )
)

-------------------------------------

Cumulative $ Value (24months):=
CALCULATE (
    SUM (Income[AmountExGST]),
   DATESINPERIOD ( 'Date'[DateAlt], LASTDATE ( 'Date'[DateAlt]), -24, MONTH ))

 

I have a requirement to use the date filter and to get teh cumulative figures based on that.

when i pick a certain date from date slicer am not getting expeced results.

My first picture is with where it works all expected. and upon date selection it is not showing results as cumulative years.. instead it only shows one year bar chart not the cumulative numbers based on that date. Also the below table is not populated at all.

Please help

2 REPLIES 2
dkay84_PowerBI
Microsoft Employee
Microsoft Employee

I'm not sure I fully follow what your saying, but you have a slicer selected for a single date in 2017, and you have year in your axis, so only values for that year will be used.

As for the table, I'm not sure what's going on there. Are you using measures in the values field for the table/matrix?

Hi, Thank you for reply.

 

Sorry please ignore about table. I fixed my measures and all good now.

 

About bars on graph with cumulative values and on year (2017) selection as you said only 2017 is appearing.

 

But my client asked me to show cumulative numbers for each year for the date in the calendar year selected..(to see all years bars on chart)

 

example: 22nd May 2017 selected then we should see on each year 22nd May what were the numbers at that point of time plotting them on each year bar

 

Hope am clear now.

 

Thank you

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors