Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I have an issue that is too specific to find existing discussions about it:
So I have calculated a duration measure to know the response time excluding weekends.
I found the below piece of code that seem to work and calculate the number of hours:
Hello,
this is great indeed
This recalculates the delay between start and end date but ignores the working days table.
(This piece of code I had)
Hi @swm78 - the DAX code was only an example. Essentially, I have used the code to add a column to a table. However you can skip this to use the DateDiff function in a measure. However, since the DateDiff result could be used in many aggregate measures (i.e. SUM, MIN, MAX, AVERAGE), I would recommend adding an column to perform the calculation when the Data is refreshed, rather that including in SUMX, MINX, MAXX expressions. As for your CALCULATETABLE, I would need more information about the data model with same data to understand what you are trying to achieve.
Hi @swm78 , thank you for your question. You could consider that the DAX function DATEDIFF - DAX Guide includes SECONDS, MINUTES and HOURS.
Table =
ADDCOLUMNS(
SELECTCOLUMNS(
{ ( DATE( 2023, 3, 31) + TIME( 13, 3, 12) , NOW() ) },
"Start", [Value1],
"End", [Value2]
),
"Seconds Difference", DATEDIFF([Start], [End] , SECOND),
"Minutes Difference", DATEDIFF([Start], [End] , MINUTE),
"Mod Difference",
VAR _diff = DATEDIFF([Start], [End] , SECOND)
VAR _day = QUOTIENT( _diff , 60 * 60 * 24 )
VAR _Mday = MOD( _diff , 60 * 60 * 24 )
VAR _hour = QUOTIENT( _Mday , 60 * 60 )
VAR _Mhour = MOD( _Mday , 60 * 60 )
VAR _minute = QUOTIENT( _Mhour , 60 )
RETURN
_day & " days " & _hour & " hours " & _minute & " minutes"
)
You can use these to measure MIN duration then convert result to Days, Hours, Minutes using QUOTIENT and MOD functions.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 7 | |
| 7 | |
| 5 | |
| 4 | |
| 3 |
| User | Count |
|---|---|
| 14 | |
| 14 | |
| 10 | |
| 8 | |
| 8 |