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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
pedroccamaraDBI
Post Partisan
Post Partisan

Weekdays between 2 dates on dim employee

Hello all
I need to create a measure that calculates the working hours between 2 dates on a dim table.
3 tables : Tab Dates, Tab TimeSheet and Tab Business Leader. The first 2 are connected through dates but with inactive connection because i have 2 other fact table.
This is the desired visual (all numbers here has nothing to do with the file attached)
Desired Result.JPG
and this is the file
https://1drv.ms/x/s!ArcWLnLtPYpTlwwGMmucTS0UIjqA?e=NkOED6 

For the Hours worked for each employee i have this measure:

Ts Hours =
CALCULATE (
SUM ( ‘Tab TimeSheet’[Time (h)] ),
USERELATIONSHIP ( ‘Tab Dates’[Date], ‘Tab TimeSheet’[Date] )
)

Now, what i need is a measure, that shows me the total of hours due to work between date min and date max on the Tab Business Leader, for each employee.

Thanks a lot everyone

Pedro

2 REPLIES 2
amitchandak
Super User
Super User

@pedroccamaraDBI , check this

https://exceleratorbi.com.au/calculating-business-hours-using-dax/

https://community.powerbi.com/t5/Desktop/Calculating-Working-hours/m-p/374255

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

Hello @amitchandak 
Thank you very much for your answer. Great content.
Unfortunately it's not for my case cose i have 3 tables, like i said above:
Tab Business Leader which is connected to Tab TimeSheet through UserID and employeeID and bothe are conected to dates, but inactive.
The measure i need is the total due hours for each employeeID according to filter dates and datemin and datemax of each employeeID.

Thanks a lot

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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