Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
Hi,
Please assist me, i'm having an issue where my duration is not suming correctly, hours are showing on minutes and minutes on seconds
DAX used: Duration =
VAR Duration = SUM(Duration])
VAR Hours =
INT ( Duration / 3600) ------//when i divided with 60 the hours come right and the minutes move to seconds.//
VAR Minutes =
INT ( MOD( Duration - ( Hours * 3600 ),3600 ) / 60)
VAR Seconds =
ROUNDUP(MOD ( MOD( Duration - ( Hours * 3600 ),3600 ), 60 ),0)
VAR H =
IF ( LEN ( Hours ) = 1,
CONCATENATE ( "0", Hours ),
CONCATENATE ( "", Hours )
)
VAR M =
IF (
LEN ( Minutes ) = 1,
CONCATENATE ( "0", Minutes ),
CONCATENATE ( "", Minutes )
)
VAR S =
IF (
LEN ( Seconds ) = 1,
CONCATENATE ( "0", Seconds ),
CONCATENATE ( "", Seconds )
)
RETURN
CONCATENATE (
H,
CONCATENATE ( ":", CONCATENATE ( M, CONCATENATE ( ":", S ) ) )
)
Below is the output:
When i divided hours with 60 instead of 3600, theres a slight improvment, but my minutes and seconds are off.
Scenerio two: Rows are not suming correctly but when i open the drop down, hh::mm:ss is correct unlike scenerio one, but the total is incorrect also.
Dax used:
This might work:
Scenerio 1:
Duration =
VAR Duration = SUM('Model Table'[Duration]) // OR [Lat Sch Activity]
VAR Hours = INT(Duration / 3600)
VAR Minutes = INT(MOD(Duration - (Hours * 3600), 3600) / 60)
VAR Seconds = MOD(MOD(Duration - (Hours * 3600), 3600), 60)
RETURN FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00") & ":" & FORMAT(Seconds, "00")
Scenerio 2:
Activity Length =
VAR Duration = IF(ISBLANK([Lat Sch Activity]), BLANK(), [Lat Sch Activity])
VAR Hours = INT(Duration / 3600)
VAR Minutes = INT(MOD(Duration, 3600) / 60)
VAR Seconds = MOD(MOD(Duration, 3600), 60)
RETURN IF(
ISBLANK(Duration),
BLANK(),
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00") & ":" & FORMAT(Seconds, "00")
)
Make sure to replace 'Model Table' with the actual name of your table in both formulas. If you still encounter issues, please provide more details about the data and the structure of your table.
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
User | Count |
---|---|
70 | |
37 | |
21 | |
18 | |
15 |
User | Count |
---|---|
126 | |
32 | |
28 | |
24 | |
24 |