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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JoKelly3
New Member

Help with running totals (cumulative daily attendance)

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/20231011111cumulative present/cumulative possible
05/09/20231020101cumulative present/cumulative possible
05/09/20231031111cumulative present/cumulative possible
05/09/20231041111cumulative present/cumulative possible
06/09/20231011122cumulative present/cumulative possible
06/09/20231021112cumulative present/cumulative possible
06/09/20231031122cumulative present/cumulative possible
06/09/20231041122cumulative present/cumulative possible
1 ACCEPTED SOLUTION
v-weiyan1-msft
Community Support
Community Support

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.

vweiyan1msft_0-1706757363709.png

 

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.

View solution in original post

2 REPLIES 2
v-weiyan1-msft
Community Support
Community Support

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.

vweiyan1msft_0-1706757363709.png

 

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.

JoKelly3
New Member

I have now managed to create a grouped index column in Power Query but I still need to create the cumulative totals

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

Top Solution Authors