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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
DAX_Defence
New Member

Running total, 2 categories, by date, into a line graph!

Good Afternoon Lovely Community, 

 

I'm after some help with a brainscratcher I've got going on. My data looks like the below;
(End date is a calculated column, if Removed is Yes, used Date removed else use TODAY())

 

NameDate AddedDate removedRemovedSpineEnd Date
Dave12/03/23nullNoA14/03/23
Jim12/03/23nullNoB14/03/23
Barbara12/03/2313/03/23YesA13/03/23
Bob13/03/23nullNoB14/03/23
Rita14/03/23nullNoB14/03/23

 

What I'd like is to create 3 running totals; one as a grand total and one for each spine, then plot all three on a line chart. 

 

So

12/03/23 would show A = 2, B = 1, Total = 3.

13/03/23 would show A = 1, B = 2, Total = 3. 

14/03/23 would show A = 1, B = 3, Total = 4. 

 

Line chart would then show this, with date as x axis. 

 

I'm completely stumped. Any help hugely appreciated. 

3 REPLIES 3
Greg_Deckler
Community Champion
Community Champion

@DAX_Defence See if this helps: Better Running Total - Microsoft Power BI Community

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thanks so much for the quick reply. 

That works really well for the total, but I can't work out how to filter that to show each "Spine"? 

@DAX_Defence It's just an extra filter clause, something like:

Better RT = 
    VAR __Date = MAX('Table'[Date])
    VAR __Spine = MAX('Table'[Spine])
    VAR __Table = FILTER(ALLSELECTED('Table'),[Spine] = __Spine && [Date] <= __Date)
RETURN
    SUMX(__Table,[Value])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors