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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
vlassauw
Frequent Visitor

Average Issue

The Power BI Query

In my Power BI query I have a Department and an Employee level

I have a measure called HoursWork and measure called HoursSick

I need percentage hours sick on hours worked

In the query I simply divide sick by worked and I get a correct percentage of course on the lowest level Employee

Some Employees have no HoursSick so the percentage there is 0

 

Query output Example:

DEP      Employee    HoursWork    HoursSick  Sick%

1                 1                  152               0              0%

1                 2                  128           120            93.75%

1                 3                    88               8              9.09%

1                 4                   112              0              0%

 

 

The Power BI Report

The report is on Department level showing

DEP        HoursWork     HoursSick      Sick%

1                   480               128           25.71%

 

The percentage is wrong as it takes the 0% rows into account as well

I want the percentage to be the  result of total hourssick divided by hourswork, meaning 128/480 = 26.67%

 

Because of this issue the column total (over all departments) is way off even more.

Anyone?

 

Thanks,

Vincent

 

1 ACCEPTED SOLUTION

That 25.71% looks to be an average of the individual percentages - it's nothing to do with taking into account (or otherwise) the rows where nobody's sick. The original measure posted in reply should work absolutely fine, and I'm thinking it's something to do with how the visual is interpreting the totals row

 

edit - just put in the data you listed and the measure listed and it works correctly out of the box:

 

thisworks.png

View solution in original post

5 REPLIES 5
v-chuncz-msft
Community Support
Community Support

@vlassauw,

 

Here you need to use a measure.

Measure =
DIVIDE ( SUM ( Table1[HoursSick] ), SUM ( Table1[HoursWork] ) )
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thank you for responding but it doesn't work, as in Power BI the measure needs to be aggregated,

If you choose Average, it will still take the 0% rows into account. Other aggregation types, as far as I can see are pointless

If you choose Don't Summarize my report is ungrouped which is not an option.

That 25.71% looks to be an average of the individual percentages - it's nothing to do with taking into account (or otherwise) the rows where nobody's sick. The original measure posted in reply should work absolutely fine, and I'm thinking it's something to do with how the visual is interpreting the totals row

 

edit - just put in the data you listed and the measure listed and it works correctly out of the box:

 

thisworks.png

Somehow it refreshed wrong when I tried your formula, so i tried again and it works, thank you!!!!

The mistake I made was I applied the formula to a column in stead of a measure

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.