Forum Discussion
Durations - Dynamic Formats or Calculation Groups? Or both?
- 3 months ago
The fix is a dynamic format string. Revert the measure to plain numeric:
ACD handling Av =
DIVIDE(SUM('Performance'[ACD handling time (days)]), SUM('Performance'[ACD calls handled]))Then select it, Measure tools ribbon, set Format to Dynamic, and paste this into the format expression:
VAR Seconds = INT ( SELECTEDMEASURE () * 86400 )
VAR Hrs = INT ( Seconds / 3600 )
VAR Mins = INT ( MOD ( Seconds, 3600 ) / 60 )
VAR Secs = MOD ( Seconds, 60 )
RETURN
"""" & FORMAT ( Hrs, "00" ) & ":" & FORMAT ( Mins, "00" ) & ":" & FORMAT ( Secs, "00" ) & """"The `""""` wraps the time as literal text while keeping the real number underneath. Now it works everywhere: tables, charts with formatted labels, conditional formatting, and over-24h shows as 25:30:00 with no rollover.
For your seven measures, paste it into each one, or set up one calculation group with this as the Format String Expression and SELECTEDMEASURE() as the expression. I'd do per-measure first to get it working, then tidy up with a calc group later if you want.
If this helped, a thumbs up and accepting the solution would be appreciated.
Best,
Shai Karmani
No worries, this bit is genuinely hidden. You want the measure's format string, not the visual's format setting, and not the dynamic format expression.
In Model view (or the Properties pane in Report view), click the measure itself and look for the Format property. Set it to Custome, and a Custom format text box appears below it. Type [hh]:mm:ss in there with no quotes. That's the spot.
Once it's set there, the format follows the measure everywhere it gets used. Type it raw, no quotes.
If this helped, a thumbs up and accepting the solution would be appreciated.
Best,
Shai Karmani
- DAST3 months agoFrequent Visitor
Thanks. I found that and tried entering it there, along with variations such as [HH]:mm:ss and [HH]:nn:ss, but all of them resulting in displaying the format string.
To be clear, I had already reset the format on the visual to default and set the measure format back to General before trying this.- Shai_Karmani3 months agoSuper User
ok so a good way to debug: remove the calculation group from whatever slicer or filter is applying it to that visual, so it's out of the picture entirely. Then with just the plain measure:
- Edit the measure so it divides the seconds total by 86400
- Format property: Custom, value [hh]:mm:ss
You should immediately see proper 01:23:45 style values. Once that's working, you can decide whether you even need the calc group. For your original use case (always render as duration in tables, raw number on charts), you honestly don't.
If you do want to keep the calc group around for some reason, open up the "S to HHMMSS" item and check those two fields. My bet is the format string is sitting in the wrong one.
- DAST3 months agoFrequent Visitor
Thanks for your help so far. I deleted the calculation group and set the model to allow implicit measures again. I set the durations to import as days (decimals) instead of seconds (whole numbers). I set the measure format back to generic, then tried applying the custom format again, both in the model view, and then when that didn't work, at the visual level. Both methods still show "[HH]:mm:ss" in the visual, regardless of how I write the format string. There must be something different about my Power BI setup. I'm running the latest version (May 2026):