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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
EpicTriffid
Helper IV
Helper IV

Summing First values in categories

So this is a little difficult to exchange.

 

I'm gathering data from teaching information. This includes teaching hours, preparation hours, and assessment hours. Teaching and preparation hours are logged perfectly fine, with unique values for each. However, because of the way the individual units are logged, assessment hours isa essentially duplicated for all entries in that unit. For example:

 

Unit 1Students: 20  
 teaching hoursprep hoursassessment hours
Geoff1220
Gary3420
Jenny5620
Carol7820

 

The assessment hours is based off the number of students, which is a static number for the whole unit. You can see that even with differeing teaching and prep hours, from a reporting point of view, they also each of 20 assessment hours. In this instance, I could just take the MAX value from that column and be done with it. But the problem compounds because each unit can have multiple delivery styles:

 

  Delivery Styleteaching hoursprep hoursassessment hours
GeoffUnit 1Lecture2520
GeoffUnit 1Seminar4520
GeoffUnit 1Workshop1520
GeoffUnit 1Lecture4520
GeoffUnit 2Seminar5635
GeoffUnit 2Workshop3335
GeoffUnit 2Workshop2535
GeoffUnit 3Lecture6240
GeoffUnit 3Seminar4140
GeoffUnit 3Lecture8440

 

You can see that when you add enough units in, and then report by individual, I then have the be able to take the MAX from each Unit rather than the whole column. Sadly, this isn't something I can solve in the way the data is gathered. 

 

What I need is to be able to take the max value for each Unit. Using the example above, I need the assessment total for Geoff to be 95, rather than 305. Hopefully that makes sense. I've tried Summarize, but I keep getting multiple column errors. I think that might be to do with it generating a table, but if it does, I don't know how I could then use the resulting table to add those numbers onto, for example, Geoffs teaching and preparation hours...

 

HALP!

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@EpicTriffid try following measure, change table and column name as per your model.

 

Total Assessment Hours = 
SUMX( 
    SUMMARIZE( 'Table', 'Table'[Teacher], 'Table'[Unit] ), 
    CALCULATE( MAX( 'Table'[assessment hours] ) ) 
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

2 REPLIES 2
parry2k
Super User
Super User

@EpicTriffid try following measure, change table and column name as per your model.

 

Total Assessment Hours = 
SUMX( 
    SUMMARIZE( 'Table', 'Table'[Teacher], 'Table'[Unit] ), 
    CALCULATE( MAX( 'Table'[assessment hours] ) ) 
)


Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Yup! Could kiss you! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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