Forum

Running Totals by C...
 
Notifications
Clear all

Running Totals by Category

5 Posts
3 Users
0 Reactions
147 Views
Philip Treacy
(@philipt)
Posts: 1631
Member Admin
Topic starter
 

Hi Mynda,

 

Thank you for your Power Query Running Totals YouTube video.  What if I have a different scenario when the running totals are by category?  Please see example below.  How can this be done in Power Query (PBI) so that I can use the data set for joining with other sets? Is there a video on that?

Thank you again,

Cristina

Student Name  Student ID   Semester    Units Earned    Running Totals

John               1111           fall 2021            5                    5

John               1111          spring 2022         6                  11

Jane               1112          spring 2019         4                   4

Jane               1112          summer 2019      3                   7

Jane               1112          fall 2021            12                 19

 
Posted : 12/07/2022 5:11 am
(@mynda)
Posts: 4761
Member Admin
 

Hi Cristina,

Welcome to our forum! Please see this on grouped running totals in Power Query.

Mynda

 
Posted : 12/07/2022 7:55 pm
(@cristinagrig)
Posts: 5
Active Member
 

Hi Mynda, 

First I had to watch a couple of other videos to familiarize myself with the idea of function and naming convention. Then I used the code you provided and it worked. I recently switched to Power BI after having used Alteryx for the past decade so you are a lifesaver for providing this code.      

 

Thank you so much,

 

Cristina

 
Posted : 15/07/2022 2:51 pm
(@cristinagrig)
Posts: 5
Active Member
 

Hi Mynda, 

 

I guess I spoke to soon.  While it worked, I noticed that the order of the semesters changed to descending order after invoking function.  It is important that the records remain sorted in ascending order by Student ID and then Semester. 

The records below before function:

StudentID         Semester      UnitsEarned     

10002             20111            3                      

10002             20123            2                      

The records after the function in descending order by Semester.  As you can see it the student first (20111 = spring 2011) earned 3 units so the running total should by 3, and then in 20123 (fall 2012) earned another 3 units, so the running total should be 5.  

StudentID         Semester      UnitsEarned      RunningTotals

10002             20123            2                        2

10002             20111            3                        5

Please help.  I must be missing a step.  Thank you again. 

Cristina

 
Posted : 15/07/2022 4:44 pm
(@cristinagrig)
Posts: 5
Active Member
 

Hi Mynda,

 

I found the missing step.  sorry for the trouble.  It works.  THANK YOU!!!

 
Posted : 15/07/2022 4:57 pm
Share: