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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
BobKoenen
Helper IV
Helper IV

Matrix with hierachy does not show correct Totals on higher agregation Dealing with Hourrates

Hi all,

 

I am creating an overview based on hourly rate and nr. of hours for employees in an Matrix using a hierarchy. In which the Department is the highest level en employee the lowest. However I cannot figure out how to deal with the HourRates. 

The data looks like this:

DepartmentPersonHourrateHoursTotal
AJohn1020200
BJane1030300
BJoe1520300
BJames50150
Total 8571850

 

When I fold the Matrix the calculations become incorrect at the department level. 

 

A 10233200
 75513825
total 852844025

 

This is because the Hourrate colomn is summed. I tried to switch off the summing in the values plane of the visual but that does not work for me because I need the totals on departmentlevel.  Using Average also is not correct because of the differences in amount of hours. 

I think i Need a formula which adds all the values on the employee level en shows that as in the total row. Not calculating the amount from the total row itself. 

 

I hope you can help me. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

The hour rate on the department level, or any level for that matter, needs to be a weighted average of the hour rates for each employee. The weights are the hours.

 

Why so? Because [Hourrate] * [Hours] = [Total] and this equation must be maintained on each row, even the last one.

 

So, the answer is easy: the hour rate must be the sum of rate * hours over all visible employees and divided by the sum of the hours for the same set of employees.

 

Best
D

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

The hour rate on the department level, or any level for that matter, needs to be a weighted average of the hour rates for each employee. The weights are the hours.

 

Why so? Because [Hourrate] * [Hours] = [Total] and this equation must be maintained on each row, even the last one.

 

So, the answer is easy: the hour rate must be the sum of rate * hours over all visible employees and divided by the sum of the hours for the same set of employees.

 

Best
D

Greg_Deckler
Community Champion
Community Champion

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

 

Also, you may need this:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Matrix-Measure-Total-Triple-Threat-Rock-amp-...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thankx this is very Helpfull

 

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.