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
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
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.