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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Vtomsons
Helper I
Helper I

# times Student taking same course & number of times students take multiple courses in the same term

Hi,

 

I have a large single enrollment dataset that I'd like to show how many times the same course (Course name) are repeated by the same student (Person ID). Example of the data set is below. I'm struggling on the best way to structure this but am leaning towards by course and having a column each for how many times the student enrolled in the course (i.e. once, twice, three, etc...). Thanks for any advice on how to approach this.

 

Course NameOne timeTwo timesThree times
ADM*1165110
ADM*1213110
ADM*4326210
SOCI*3634411

 

Data Set:

Course SubjectCourse NumberCourse NameRegistration TermPerson ID
ADM1165ADM*11652019/SM3558252
ADM1165ADM*11652020/SM3333333
ADM1165ADM*11652020/SM3558252
ADM1213ADM*12132019/SM3431187
ADM1213ADM*12132019/SM3333335
ADM1213ADM*12132020/SM3431187
ADM4326ADM*43262022/FA3558252
ADM4326ADM*43262022/FA3333333
ADM4326ADM*43262022/FA3333334
ADM4326ADM*43262022/WI3558252
SOCI3634SOCI*36342020/FA3333336
SOCI3634SOCI*36342021/FA3333336
SOCI3634SOCI*36342022/FA3558252
SOCI3634SOCI*36342022/FA3333336
SOCI3634SOCI*36342022/WI3558252
SOCI3634SOCI*36342022/WI3333337
SOCI3634SOCI*36342022/WI3333338
SOCI3634SOCI*36342022/WI3333339
SOCI3634SOCI*36342022/WI

3333340

1 REPLY 1
ronrsnfld
Super User
Super User

Group by Course Name and Person ID with Count aggregation. Then Pivot on the Count field with Count aggregation:

 

let

//Change next line to reflect actual data source
    Source = Excel.CurrentWorkbook(){[Name="Table1"]}[Content],
    
    #"Changed Type" = Table.TransformColumnTypes(Source,{
        {"Course Subject", type text}, {"Course Number", Int64.Type}, {"Course Name", type text}, 
        {"Registration Term", type text}, {"Person ID", Int64.Type}}),
    #"Grouped Rows" = Table.Group(#"Changed Type", {"Course Name", "Person ID"}, {
        {"Count", each Table.RowCount(_), Int64.Type}}),
    #"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Grouped Rows", 
        {{"Count", type text}}, "en-US"), 
        List.Distinct(Table.TransformColumnTypes(#"Grouped Rows", 
            {{"Count", type text}}, "en-US")[Count]), "Count", "Person ID", List.NonNullCount),
    
    #"Reordered Columns" = Table.ReorderColumns(#"Pivoted Column",{"Course Name", "1", "2", "3"})
in
    #"Reordered Columns"

 

ronrsnfld_0-1719181381162.png

 

 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.