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
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/time | result |
| 3/3/22 4:20 AM | 6 days 7 hours |
| 4/3/22 2:16 AM | 5 days 7 hours |
| 5/4/22 11:20 AM | 4 days 7 hours |
| 6/4/22 4:20 AM | 3 days 7 hours |
| 7/4/22 4:20 AM | 2 days 7 hours |
Solved! Go to Solution.
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:
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.
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:
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.
You can Check this link from Radacad
https://radacad.com/calculate-duration-in-days-hours-minutes-and-seconds-dynamically-in-power-bi-usi...
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 38 | |
| 32 | |
| 18 | |
| 16 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 40 | |
| 34 | |
| 25 |