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
Anonymous
Not applicable

Relation between 3 tables

Hey everyone,

 

I have a file of three tables of mediocre quality. Therefore, it's difficult to get the data I want. 

 

In the table Employee, I have a column with the hours they work per week. As a result, I get 908. This is the sum of hours of the employees in the table Employee. But it doesn't add up. For example, when I select two week in the Calendar, it's still 908 instead of 1816. So, the relation doesn't work correctly, and I don't understand why. 

 

The relations between Calendar and Hours and between Hours and Employee work in both directions. The relation between Calendar and Hours is one-to-many and the relation between Employee and Hours is also one-to-many. 

 

Hours worked total incorrect.pngRelationship hours worked.png

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Try a measure like

 


AverageX(summarize(Hours, employee[Employee ID], Date[Year and Week No], "_1", sum(Hours[hours worked]) , "_2", Max(Hours Worked Per Week])), divide([_1],[_2]))

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
Anonymous
Not applicable

Hey @amitchandak ,

 

Thanks for your reply. Unfortunately, it doesn't work. So, I've made a dummy data set and a pbix-file. You can find the links below:

 

Excel-file:

https://docs.google.com/spreadsheets/d/1N4bAcrrYX9EnOpaGZHwUWaQYj5Pen2TU/edit?usp=sharing&ouid=11807...

 

PBIX-file

https://drive.google.com/file/d/1pWUBc-rNLpo7u2AR3DiZuWPGZjIunZbA/view?usp=sharing

 

 

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.