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
Anonymous
Not applicable

Cumulative column from time with categorical filter

Hi, I would like to calculate a cumulative column of [Duration] as a function of increasing [Time]. I would also like to perform the calculation filtered by [Name]. The bolded column, [Cumulative Duration] below is my goal. 

 

Thanks in advance, I really appreciate the help! 

 

NameDurationTimeCumulative Duration
Brett0.24/2/2020 15:300.2
Brett0.34/2/2020 15:320.5
Brett0.24/2/2020 15:350.7
John0.34/2/2020 15:290.3
John0.44/2/2020 15:320.7
John0.24/2/2020 15:350.9
John0.14/2/2020 15:511
1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Jkilb ,

Duración acumulativa: calculate(sum([Duration]), filter(Table,[Name] á earlier([Name]) && [Time] <earlier([Time])))

Or
Cumulative duration: sumx( filter(Table,[Name] á earlier([Name]) && [Time] <earlier([Time])),[Duration])

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
v-jingzhang
Community Support
Community Support

Hi @Anonymous  

Create a calculated column:

Column = CALCULATE(SUM('Table'[Duration]),ALLEXCEPT('Table','Table'[Name]),'Table'[Time] <= EARLIER('Table'[Time]))

v-jingzhang_0-1600306141039.png

 

Or create a measure:

Measure = CALCULATE(SUM([Duration]), FILTER(ALLEXCEPT('Table','Table'[Name]),'Table'[Time] <=MAX('Table'[Time])))

v-jingzhang_1-1600306141042.png

Best Regards,

Community Support Team _ Jing Zhang

If this post helps, please consider Accept it as the solution to help other members find it.

amitchandak
Super User
Super User

@Jkilb ,

Duración acumulativa: calculate(sum([Duration]), filter(Table,[Name] á earlier([Name]) && [Time] <earlier([Time])))

Or
Cumulative duration: sumx( filter(Table,[Name] á earlier([Name]) && [Time] <earlier([Time])),[Duration])

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
Greg_Deckler
Community Champion
Community Champion

@Anonymous - Should be something like:

Column = SUMX(FILTER('Table',[Time]<=EARLIER([Time])&&[Name]=EARLIER([Name])),[Duration])


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