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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
kdunaev
Regular Visitor

Help with aggregation

Hello! I am new on here - first post!!

I have a measure calculated as: Missed Meal Hrs = count('Final Data'[Employee ID])*.5

I am trying to create another measure that would take a min value of the above measure and another value:

Missed Meal OT = min(sum('my data'[Overtime Hours]),[Missed Meal Hrs])

the structure of my data is such that for each [Employee ID] I have multiple rows. then all Employee IDs can be grouped into areas. When I look at my data as a table where each row is an Employee ID - the 2 formulas above calculate correctly. But when I take Employee IDs out of the table, and each row is now an Area - the Missed Meal OT formula does not aggregate at the Employee ID level, and tries to just use the totals of each area, which is not what I want. Any help would be greatly appreciated!

5 REPLIES 5
amitchandak
Super User
Super User

@kdunaev ,Can you share sample data and sample output.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

For some reason, I'm having a hard time with copying a table into the body of the comment and don't see how to attach a file. Hopefully this link works:

 

https://www.dropbox.com/s/atwxz9wezhz1tna/Book1.xlsx?dl=0

 

 

Division

Employee IDMissed Meal HrsOT HoursMissed Meal OT hours
AA123452.500
AA123462.500
AA123472.50.220.22
AA123482.59.922.5
AA123492.52.182.18
AA123502.50.050.05
BB123512.52.932.5
BB123522.500
BB123532.50.60.6
BB123542.53.752.5
BB123552.54.822.5
BB123562.50.150.15

 

 

Desired outputMissed Meal HrsOT HoursMissed Meal OT hours
AA total15.0012.374.95
BB Total15.0012.258.25

 

 

What I am getting:Missed Meal HrsOT HoursMissed Meal OT hours
AA total15.0012.3712.37
BB Total15.0012.2512.25

Hi @kdunaev ,

 

You can use the below measures.

 

Missed Meal OT Hr = CALCULATE(SUM(Table5[Missed Meal OT hours]), ALLEXCEPT(Table5,Table5[Division]))
 
Missed Meal = CALCULATE(SUM(Table5[Missed Meal Hrs]), ALLEXCEPT(Table5,Table5[Division]))
 
OT Hourss = CALCULATE(SUM(Table5[OT Hours]), ALLEXCEPT(Table5,Table5[Division]))
2.JPG
 
 
Regrards,
Harsh Nathani
 
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!

@kdunaev , I think somehow I am not getting what you were getting

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-accessibility-keyboard-shortcuts

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.