Power BI measures often store durations as a number of seconds. This article shows how to display that value as hh:mm:ss in Power BI.

Quick answer: Convert the total seconds into hours, minutes, and seconds and return a formatted text value. This approach also works when the duration is longer than 24 hours.

Assume the existing measure is [time in seconds]. Create the following measure:

time hh:mm:ss =
VAR TotalSeconds = [time in seconds]
VAR hh = INT(TotalSeconds / 3600)
VAR mm = INT(MOD(TotalSeconds, 3600) / 60)
VAR ss = MOD(TotalSeconds, 60)
RETURN
    FORMAT(hh, "0") & ":" & FORMAT(mm, "00") & ":" & FORMAT(ss, "00")

The result can be displayed in a card or table as h:mm:ss. Because the result is text, it is intended for display rather than further numeric calculations.

Power BI measure displaying seconds as hours minutes and seconds

Pro tips:
1. If your value is already a date/time value, use Power BI’s format settings instead of converting seconds.
2. Learn how to export Power BI measures using PowerShell.

See more

Visual Studio Marketplace

SSIS Catalog Migration Wizard

Extend Visual Studio with an easy way to migrate SSIS Catalog projects.

Kunal Rathi

With over 15 years of experience in data engineering and analytics, I've assisted countless clients in gaining valuable insights from their data. As a dedicated supporter of Data, Cloud and DevOps, I'm excited to connect with individuals who share my passion for this field. If my work resonates with you, we can talk and collaborate.