Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
Hi everyone,
I'm working with time-based measures in Power BI and trying to display durations in a minutes:seconds (mm:ss) format. I’ve run into a limitation that I’d like to understand better.
Here’s a simplified version of the measure I’m using:
---------------------------------------------------------
DurationMeasure =
VAR ValueA =
CALCULATE(
SUM('DataTable'[Value]),
'DataTable'[Metric] = "MetricA",
'DimensionTable'[Category] IN SelectedCategories
)
VAR ValueB =
CALCULATE(
SUM('DataTable'[Value]),
'DataTable'[Metric] = "MetricB",
'DimensionTable'[Category] IN SelectedCategories
)
VAR DurationInSeconds = DIVIDE(ValueA, ValueB)
RETURN
DurationInSeconds
---------------------------------------------------------
If I wrap the result using TIME(0, 0 DurationInSeconds), it displays perfectly in table visuals as mm:ss.
However, when I try to use this same measure in a chart visual (like bar or line), the value disappears or the axis breaks. It seems like TIME() returns a datetime value that isn’t compatible with chart axes.
I’d really appreciate any insights, explanations, or workarounds from the community. If there’s a recommended way to plot durations in mm:ss format directly on chart axes, I’d love to learn more.
Thanks in advance for your help!
Solved! Go to Solution.
Hi @Daniele__R
You can use the dynamic format of Measure to implement it, as shown in the following figure:
The format expression as bellow:
VAR CurMeasureVal = SELECTEDMEASURE()
RETURN
""""&FORMAT(TIME(0,0,CurMeasureVal),"nn:ss")&""""
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Hi @Daniele__R
You can use the dynamic format of Measure to implement it, as shown in the following figure:
The format expression as bellow:
VAR CurMeasureVal = SELECTEDMEASURE()
RETURN
""""&FORMAT(TIME(0,0,CurMeasureVal),"nn:ss")&""""
Did I answer your question? If yes, pls mark my post as a solution and appreciate your Kudos !
Thank you~
Thanks for the solution : it worked really well and helped me get the formatting I needed!
I still have a small problem though: on the Y-axis of my visual, I keep getting the same value repeated across each level, which makes it hard to read or interpret properly. If you (or anyone else) has ideas on how to improve the Y-axis display in this kind of setup, I’d really appreciate it.
Thanks in advance for any suggestions!
Hi @Daniele__R
1. When you wrap your measure with-
TIME(0, 0, [DurationInSeconds])
It returns a datetime value (a time portion of a date). Table visuals can display this easily using the format string mm:ss but chart visuals (bar, line, etc.) treat the Y-axis as numeric and a datetime type isn’t numeric, so the axis can’t render it. That’s why it appears blank or the axis breaks.
Note:Keep your measure numeric (in seconds) and only format it for display.
2. Create a base numeric measure (your current logic):
DurationSeconds =
DIVIDE([ValueA], [ValueB])
3. Then create a formatted measure just for tables or cards:
Duration mm:ss =
VAR MinPart = INT([DurationSeconds] / 60)
VAR SecPart = MOD([DurationSeconds], 60)
RETURN
FORMAT(MinPart, "00") & ":" & FORMAT(SecPart, "00")
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.
User | Count |
---|---|
10 | |
6 | |
4 | |
3 | |
3 |
User | Count |
---|---|
13 | |
11 | |
8 | |
8 | |
8 |