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
RicardoAlfa
Frequent Visitor

datediff Hours

Hello All,

 

I´m struggling on how to solve a problem using Datediff function,

I have two columns, start and end date with dd/mm/hh format.

I need to show the hours that passsed between two dates in diferent days, but my problem is, I must only  count the workday hours (9:00:00 am to 18:00:00 pm) and ( monday to friday)

 

My code just take total hours:

Servicios_Horas = DATEDIFF('Maester Estimaciones'[Fecha de Inicio Estimación],'Maester Estimaciones'[Fecha Fín Estimación],HOUR)

has anybody got an idea on how i would approach this?

 

thanks, Ricardo

1 ACCEPTED SOLUTION
RicardoAlfa
Frequent Visitor

Thanks a lot Greg!

 

Your Quick measure was helpful to show my information in a nice format.

View solution in original post

3 REPLIES 3
RicardoAlfa
Frequent Visitor

Thanks a lot Greg!

 

Your Quick measure was helpful to show my information in a nice format.

Greg_Deckler
Community Champion
Community Champion

Use my Net Work Days quick measure to figure out the number of working days. Multiple by 24 and adjust depending on your start/end times. Sample data would help. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Net Work Days Quick Measure: https://community.powerbi.com/t5/Quick-Measures-Gallery/Net-Work-Days/m-p/367362



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

Hi Greg,

 

Great solution with creating Network days function in power bi. Business days excluding holidays are accurate for my data output, but i am having trouble adjusting the code for business hours of 7:30am to 5pm. Where in the code do I adjust, and how do I adjust? Also, some date differences are under 1 hour, so would you able to code it for example '0 hours 13 minutes' as well? 

 

Thanks,

Emma

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.