The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
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
User | Count |
---|---|
25 | |
10 | |
8 | |
7 | |
6 |
User | Count |
---|---|
32 | |
12 | |
10 | |
10 | |
9 |