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! Learn more

Reply
nisuomi
Resolver I
Resolver I

Cumulative sum when target achieved, get the date

Hi community,

 

I am facing a bit of a problem with my DAX. Or more specifically the lack of my DAX skills maybe at this point ant the logic is not in my brain.. 

 

I have a situation where we follow cumulative sum and how it progress. We also have a target set according to that cumulative sum. I can create a DAX formula how to get the cumulative sum progress and it nicely shows in the table how it progresses by date. But I can't get the date when the target has achieved. 

 

So I would like to generate a metric where it stores the date when the target has been achieved. The dax I have created always returns a date, that when the sales has started. Any ideas?

 

my dax for the cumulative:

t_cumu = CALCULATE(SUMX(VALUES(Table[Country]); Table[Sales]);
FILTER(
ALL(Table[Date]);
Table[Date] <= MAX(Table[Date])
)
)

 

Here is a screen cap how it works

tabletable

 

So i would love to get the date 11.10.2016 out from this where it has gone over the target... 

If someone could point me to right direction, it would be superb! Thanks 🙂 

 

 

 

Cheers,

Niko

 

9 REPLIES 9
Phil_Seamark
Microsoft Employee
Microsoft Employee

Is your Target always 100 or is it variable?

 

Essentially I would create a measure to apply a filter show rows where t_cumu is higher than the target and then grab the MIN(Date).

 

I've hardcoded the target but this could be made dynamic

 

 

Target Hit Date = CALCULATE(
					MIN(MyTable[Date]),
					FILTER(
							MyTable,
							MyTable[t_cumu] > 100
						)
					)

 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

Hi @Phil_Seamark !

 

Yes the Target is at the moment only 100 so no need to use any variable here.

I tried the calculation that you provided, but for some reason it returns a (blank) value for me. Any idea what could cause this?

 

Thank you for your help already 🙂 I try, if I can solve it somehow on my own also .. 

 

 

 

Cheers,

Niko

What is the name of your table?


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

@Phil_Seamark it is named like DataTable.

I replaced MyTable with that but did not work.. 

Are you creating it as a calculated measure? 

 

And did you replace all three occurrences? 


To learn more about DAX visit : aka.ms/practicalDAX

Proud to be a Datanaut!

@Phil_Seamark could it have something to do with that I have a country as a filter? So it does not how to get the date on country level or something?

 

 

 

Cheers,

Niko

Hi @nisuomi,

You said you have a country as a filter, please check if there is no date for targeted 100, so it returns blank. Based on your description, the issue is werid. Could you share your .pbix for futher analysis?

Best Regards,
Angelia

 

 

Hi! I'm trying to do the same thing but with measures. I have attached the pbix file. What I am trying to accomplish is to display the month when my target is reached. I did something similar to your suggestion:

 

Measure = 
VAR __average = [Average of preceding three years]
VAR __cumm = [Cummulative Total]
RETURN
CALCULATE(MINX(DateTable, MIN(DateTable[Date])), FILTER(Products, __average < __cumm),VALUES(DateTable[Date].[Year]))

 

And this is the result:Screenshot (378).pngWhat I'm trying to do though is to do a yearly report and display the minimum among the results of the measure in the monthy report. In this case, it should display 5/1/2016 in the yearly report but it is displaying 1/1/2016.

 

 

@Phil_Seamark yes to both of your questions.

I do not know if it has something to do with the some calc or date field..

 

This is what i have done:

Target Hit Date = CALCULATE( MIN(DataTable[Date]); FILTER(DataTable; DataTable[t_cumu] >= 100 ) )

 

 

 

Cheers,

Niko

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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