The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
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!
Name | Duration | Time | Cumulative Duration |
Brett | 0.2 | 4/2/2020 15:30 | 0.2 |
Brett | 0.3 | 4/2/2020 15:32 | 0.5 |
Brett | 0.2 | 4/2/2020 15:35 | 0.7 |
John | 0.3 | 4/2/2020 15:29 | 0.3 |
John | 0.4 | 4/2/2020 15:32 | 0.7 |
John | 0.2 | 4/2/2020 15:35 | 0.9 |
John | 0.1 | 4/2/2020 15:51 | 1 |
Solved! Go to Solution.
@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])
Hi @Anonymous
Create a calculated column:
Column = CALCULATE(SUM('Table'[Duration]),ALLEXCEPT('Table','Table'[Name]),'Table'[Time] <= EARLIER('Table'[Time]))
Or create a measure:
Measure = CALCULATE(SUM([Duration]), FILTER(ALLEXCEPT('Table','Table'[Name]),'Table'[Time] <=MAX('Table'[Time])))
Best Regards,
Community Support Team _ Jing Zhang
If this post helps, please consider Accept it as the solution to help other members find it.
@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])
@Anonymous - Should be something like:
Column = SUMX(FILTER('Table',[Time]<=EARLIER([Time])&&[Name]=EARLIER([Name])),[Duration])
User | Count |
---|---|
68 | |
63 | |
59 | |
54 | |
28 |
User | Count |
---|---|
182 | |
81 | |
63 | |
47 | |
41 |