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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
efowler
Helper II
Helper II

How to Aggregate based on DateDiff Column?

Hi, I am trying to show a line chart in Power BI based on a DateDiff column.    The example in Excel is attached as well as how it currently looks in Power BI.   Any suggestions on how I can do a Sum (running total) of the value then show the line graphs as a cummulative total of the values called R1000?  

 

X Axis = Date Diff "MIS" 1 through 50

Y Axis = Cumulative total "R1000" based on the prior Date Diff value

Legend = 2018, 2019, 2020Power BI (Bad)Power BI (Bad)MS Excel (Good)MS Excel (Good)

1 ACCEPTED SOLUTION

Hi here is what I think gets you what you are looking for

 

Cummulative R1000 = 
	CALCULATE(
		[R1000], 
			filter(
                                allselected('warranty'[MIS]), 'warranty'[MIS]<=max('warranty'[MIS])
                     )
)

 

Also find the updated pbix



I hope this helps,
Richard

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

Proud to be a Super User!


View solution in original post

7 REPLIES 7
richbenmintz
Resident Rockstar
Resident Rockstar

Hi @efowler ,

 

Below you will find an example of a running total calculation, that should get you going in the right direction.

Cummulative R1000 = 
	Calcluate(
		SUM('table'[R1000]), 
			filter(
                                allselected('table'[MIS (Failure)]), 'table'[MIS (Failure)]<=max('table'[MIS (Failure)])
                     )
)

 

Hope that helps,

 



I hope this helps,
Richard

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

Proud to be a Super User!


Hi, thanks..    R1000 is a measure.  Does that make a difference?   I can not find the 'table'[R1000], I believe that is because it is a measure?

Hi @efowler ,

 

'table' is a place holder as i do not know the name of your table, for the measure name please leave out the table name



I hope this helps,
Richard

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

Proud to be a Super User!


I can't add my table because the data I am trying to create the running total on is a measure.  The MIS is a calculated column 

Hi @efowler ,

 

Please provide a sample pbix file, will make it much easier to craft a working measure for you



I hope this helps,
Richard

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

Proud to be a Super User!


Hi, the sample .pbix file is attached.   

 

Link to .pbix file 

Hi here is what I think gets you what you are looking for

 

Cummulative R1000 = 
	CALCULATE(
		[R1000], 
			filter(
                                allselected('warranty'[MIS]), 'warranty'[MIS]<=max('warranty'[MIS])
                     )
)

 

Also find the updated pbix



I hope this helps,
Richard

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

Proud to be a Super User!


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.