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
sumitnegi1266
Frequent Visitor

Need help with DAX formula

Hi,

I have below table and need to calculate below:

1. Calculate Cumulative Sum of Forecast Value till today's date i.e. 15th Aug

2. Add these i.e. 'Value to Add' + Cumulative Sum = 15 + 75 = 90

3. Find the date in date column where Cumulative Sum is equal or just less than above value i.e. 90. The result should be 16th-Aug-23

sumitnegi1266_2-1692111246530.png

 

Any help is greatly appreciated, many thanks!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@sumitnegi1266 , Hop you already have measure

 

Cumm Sum = CALCULATE(SUM(Table[Value]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

Date = Minx(Values('Date'[date]), if([Cumm Sum]>90, [Date], blank()))  -1

 

or

 

Date = calculate( Minx(Values('Date'[date]), if([Cumm Sum]>90, [Date], blank())) , allselected())  -1

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
sumitnegi1266
Frequent Visitor

@amitchandak I need to now calculate the cumulative sum at a certain date. I have a days measure which I am adding with the date output e.g. 16th Aug + 4 days = 20th Aug. I then need to calculate Cumulative sum for 20th Aug, which should be 160

 

sumitnegi1266_0-1692194709766.png

 

sumitnegi1266
Frequent Visitor

It worked as expected. Thank you so much @amitchandak 🙂

amitchandak
Super User
Super User

@sumitnegi1266 , Hop you already have measure

 

Cumm Sum = CALCULATE(SUM(Table[Value]),filter(all('Date'),'Date'[date] <=max('Date'[date])))

 

Date = Minx(Values('Date'[date]), if([Cumm Sum]>90, [Date], blank()))  -1

 

or

 

Date = calculate( Minx(Values('Date'[date]), if([Cumm Sum]>90, [Date], blank())) , allselected())  -1

 

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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