Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am fairly new to Power Bi so forgive my ignorance. I have some student attendance data and I would like to see it cumulatively (the reason for this is I have another calculation to work out the number of students per week that are below 90% attendance which would run from the cumulative attendance). I need a way to calculate the 'cumulative present' and 'cumulative possible' for each student for each day. I've tried a few different ways so far but not had any luck with any of them.
I would be massively grateful for some help!- Thanks, Jo
Here is my data:
Date | Unique ID | Present | Possible | Cumulative Present | Cumulative Possible | Attendance |
05/09/2023 | 101 | 1 | 1 | 1 | 1 | cumulative present/cumulative possible |
05/09/2023 | 102 | 0 | 1 | 0 | 1 | cumulative present/cumulative possible |
05/09/2023 | 103 | 1 | 1 | 1 | 1 | cumulative present/cumulative possible |
05/09/2023 | 104 | 1 | 1 | 1 | 1 | cumulative present/cumulative possible |
06/09/2023 | 101 | 1 | 1 | 2 | 2 | cumulative present/cumulative possible |
06/09/2023 | 102 | 1 | 1 | 1 | 2 | cumulative present/cumulative possible |
06/09/2023 | 103 | 1 | 1 | 2 | 2 | cumulative present/cumulative possible |
06/09/2023 | 104 | 1 | 1 | 2 | 2 | cumulative present/cumulative possible |
Solved! Go to Solution.
Hi @JoKelly3 ,
Based on the sample and description you provided,
you might consider using the following code to create two Calculated Columns.
Cumulative Present = CALCULATE(SUM('Table'[Present]),
FILTER(ALLEXCEPT('Table','Table'[Unique OD]),
'Table'[Date] <= EARLIER('Table'[Date]))
)
Cumulative Possible = CALCULATE(SUM('Table'[Possible]),
FILTER(ALLEXCEPT('Table','Table'[Unique OD]),
'Table'[Date] <= EARLIER('Table'[Date]))
)
Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @JoKelly3 ,
Based on the sample and description you provided,
you might consider using the following code to create two Calculated Columns.
Cumulative Present = CALCULATE(SUM('Table'[Present]),
FILTER(ALLEXCEPT('Table','Table'[Unique OD]),
'Table'[Date] <= EARLIER('Table'[Date]))
)
Cumulative Possible = CALCULATE(SUM('Table'[Possible]),
FILTER(ALLEXCEPT('Table','Table'[Unique OD]),
'Table'[Date] <= EARLIER('Table'[Date]))
)
Result is as below.
Best Regards,
Yulia Yan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I have now managed to create a grouped index column in Power Query but I still need to create the cumulative totals