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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
sanjanarama
Resolver I
Resolver I

difference between current time and datetime column excluding weekend

I wanted result in days and hours format where result is ----- difference of current date time and create date time column , excluding weekend

 

create date/timeresult
3/3/22 4:20 AM6 days 7 hours
4/3/22 2:16 AM5 days 7 hours
5/4/22 11:20 AM4 days 7 hours
6/4/22 4:20 AM3 days 7 hours
7/4/22 4:20 AM2 days 7 hours
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @sanjanarama ,

 

Try this expression:

assum today is 2022.3.15 =
VAR _today =
    DATE ( 2022, 3, 15 )
VAR _workday =
    COUNTROWS (
        FILTER ( CALENDAR ( [create date/time], _today ), WEEKDAY ( [Date], 2 ) < 6 )
    )
VAR _time_hour =
    DATEDIFF ( [create date/time].[Date], [create date/time], HOUR )
RETURN
    _workday & " days " & _time_hour & " hours"

result:

vchenwuzmsft_0-1647334755024.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-chenwuz-msft
Community Support
Community Support

Hi @sanjanarama ,

 

Try this expression:

assum today is 2022.3.15 =
VAR _today =
    DATE ( 2022, 3, 15 )
VAR _workday =
    COUNTROWS (
        FILTER ( CALENDAR ( [create date/time], _today ), WEEKDAY ( [Date], 2 ) < 6 )
    )
VAR _time_hour =
    DATEDIFF ( [create date/time].[Date], [create date/time], HOUR )
RETURN
    _workday & " days " & _time_hour & " hours"

result:

vchenwuzmsft_0-1647334755024.png

 

Pbix in the end you can refer.

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

rocky09
Solution Sage
Solution Sage

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

Check out the April 2026 Power BI update to learn about new features.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.