How to Convert Seconds to Minutes in Power BI

Cody Schneider••8 min read

Wrestling with time data is a classic rite of passage for anyone using Power BI. You've got a column of numbers, like average session duration from Google Analytics or call length from your CRM, but they're all in seconds. While 185 seconds is technically accurate, it’s not very intuitive for your team or stakeholders. What you really want to see is a clean and simple 03:05. This article will walk you through exactly how to convert raw seconds into a tidy minutes-and-seconds format (MM:SS) using DAX in Power BI.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Why Does Power BI Need Help With This?

You might wonder why Power BI doesn’t just have a “convert to minutes” button. The reason is context. When you import a column with numbers like 90, 150, or 400, Power BI sees them as whole numbers (integers), not as units of time. Without you giving it specific instructions, it has no way of knowing those numbers represent seconds and not, say, the number of sales or website visits.

If you try to simply change the data type of your seconds column to "Time," you’ll get some very strange results. Power BI interprets number values as a fraction of a 24-hour day in its own decimal system. This causes it to convert your duration into a specific time of day (like 12:03:05 AM), which isn't what you're looking for. To properly translate a duration, we need to create our own logic using DAX.

Your Goal: From Raw Seconds to a Clean MM:SS Format

Let's be clear about the outcome. Your goal is to take a raw, numeric column of seconds and create a new column that formats it into a text-based, human-readable format.

Here’s an example of what we're aiming for:

  • Take a number like 95 and convert it to '01:35'.
  • A value of 240 should become '04:00'.
  • A short duration of 45 should become '00:45'.

This conversion makes your reports instantly easier to understand at a glance, allowing your audience to focus on the insights, not on doing mental math.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

How to Create a Calculated Column in DAX to Convert Seconds to Minutes

The most straightforward way to solve this is by creating a calculated column in your data table. A calculated column performs a calculation for each row of your table and stores the result as a new column - perfect for this kind of row-by-row conversion.

Here are the step-by-step instructions.

Step 1: Understand the Underlying Logic

Before writing any code, it’s helpful to understand the basic math. It’s simpler than you think!

  • To find the minutes: We need to divide the total seconds by 60 and take only the whole number part. For example, 155 seconds divided by 60 is 2.58. The whole number part (INT) is 2. So, we have 2 full minutes.
  • To find the remaining seconds: We need to find the remainder after dividing by 60. For this, we use a function called MOD (or modulo). For example, MOD(155, 60) gives us 35. These are our leftover seconds.

Putting it together, 155 seconds becomes 2 minutes and 35 seconds.

Step 2: Create a New Calculated Column

First, navigate to the “Data” view in Power BI by clicking the table icon on the left-hand panel. Select the table that contains your seconds column. In the "Table tools" ribbon menu at the top, click on “New column.”

This will open up the formula bar where you can type your DAX expression.

Step 3: Write and Apply the DAX Formula

Now, let's turn our logic into a DAX formula. In the formula bar, type the following expressions. Be sure to replace 'YourTable'[SecondsColumn] with the actual name of your table and the column that contains the seconds data.

Duration (MM:SS) = VAR TotalSeconds = 'YourTable'[SecondsColumn] VAR Minutes = INT( TotalSeconds / 60 ) VAR RemainingSeconds = MOD( TotalSeconds, 60 ) RETURN FORMAT( Minutes, "00" ) & ":" & FORMAT( RemainingSeconds, "00" )

Press Enter to create the column. You should immediately see your new column appear in the table, populated with the nicely formatted time values.

GraphedGraphed

Build AI Agents for Marketing

Build virtual employees that run your go to market. Connect your data sources, deploy autonomous agents, and grow your company.

Watch Graphed demo video

Step 4: Breaking Down The DAX Formula

Let's dissect what each part of that formula does so you know exactly what’s happening:

  • Duration (MM:SS) =: This is simply naming our new calculated column.
  • VAR TotalSeconds = 'YourTable'[SecondsColumn]: VAR allows us to create a temporary variable. Here, we're just creating a clean reference to the value in our original seconds column for the current row. This makes the formula easier to read and maintain.
  • VAR Minutes = INT( TotalSeconds / 60 ): This is our first piece of logic. We divide the total seconds by 60, and the INT() function truncates the result to a whole number, giving us the number of full minutes.
  • VAR RemainingSeconds = MOD( TotalSeconds, 60 ): Here, the MOD() function calculates the remainder when TotalSeconds is divided by 60. That's the part we need for our seconds value.
  • RETURN: This keyword tells Power BI we're done with our variable declarations and are ready to define the final output.
  • FORMAT( Minutes, "00" ) & ":" & FORMAT( RemainingSeconds, "00" ): This is the magic formatting step. The FORMAT() function turns our numbers into text strings. The "00" argument ensures that single-digit numbers get a leading zero (so 5 becomes "05"). The ampersand (&) concatenates - or joins - the minutes, a colon, and the seconds into a single piece of text like "03:05".

An Important Consideration: Sorting and Aggregating

Since the output of our formula is a text string, you can't perform mathematical actions such as calculating an average or sum on it. You would need to do that on your original seconds column. Similarly, if you try to sort a table by this new column, it will sort alphabetically (e.g., "10:15" comes before "02:30"). To sort chronologically, keep the original numeric seconds column in your visualizations and use the "Sort by column" feature in Power BI to sort your Duration (MM:SS) text column by your numeric seconds column.

Going Further: Formatting for Hours, Minutes, and Seconds (HH:MM:SS)

What if you have much longer durations, like tracking agent time on a project over several hours? You can easily extend the same logic to include hours. The math is very similar, we just need to account for the 3,600 seconds in an hour.

You can use this modified DAX formula:

Duration (HH:MM:SS) = VAR TotalSeconds = 'YourTable'[SecondsColumn] VAR Hours = INT ( TotalSeconds / 3600 ) VAR Minutes = INT ( MOD( TotalSeconds, 3600 ) / 60 ) VAR RemainingSeconds = MOD ( TotalSeconds, 60 ) RETURN FORMAT( Hours, "00" ) & ":" & FORMAT( Minutes, "00" ) & ":" & FORMAT( RemainingSeconds, "00" )

How the Hours Formula Works

  • VAR Hours = INT ( TotalSeconds / 3600 ): Calculates the number of full hours.
  • VAR Minutes = INT ( MOD( TotalSeconds, 3600 ) / 60 ): First, MOD(TotalSeconds, 3600) finds the seconds left over after accounting for the hours. Then it divides that result by 60 to find the number of minutes, using INT() to keep it a whole number.
  • VAR RemainingSeconds = MOD( TotalSeconds, 60 ): This logic stays exactly the same, as it finds the final seconds leftover.

Free PDF · the crash course

AI Agents for Marketing Crash Course

Learn how to deploy AI marketing agents across your go-to-market — the best tools, prompts, and workflows to turn your data into autonomous execution without writing code.

Alternative Method: Using the QUOTIENT Function

DAX often provides multiple ways to achieve the same result. The QUOTIENT function is a slightly cleaner way to perform the integer division we did with INT(). It's designed specifically to get the integer part of a division while discarding the remainder. Your minutes formula can get some cleanup this way:

Formula Using QUOTIENT Method

Duration (MM:SS) 2 = VAR TotalSeconds = 'YOUR_TABLE'[Total Seconds] VAR Minutes = QUOTIENT(TotalSeconds, 60) VAR Remaining = MOD(TotalSeconds, 60) RETURN FORMAT(Minutes, "00" ) & ":" & FORMAT(Remaining, "00")

The result is the same here. Using INT(x/60) vs. QUOTIENT(x,60) is purely a matter of personal preference or which you find more readable.

Step 5: Using Your Formatted Duration Column in Visuals

Once you’ve created the new calculated column, you can treat it like any other field in reports. Just drag it onto table, matrix cards, or any other visualization. You can use this to make your reports more clear and present your audience with easily readable insights.

Final Thoughts

Turning a raw number of seconds into a nicely formatted MM:SS string is a must-have skill for anyone serious about building clean and effective reports in Power BI. By using a calculated column with variables and leveraging functions like INT, MOD, and FORMAT, you can easily handle time-based duration data and present it in a way that everyone can understand.

While mastering DAX can make you a Power BI expert, sometimes you just want insights without getting stuck on formulas. We built Graphed to simplify these kinds of reporting headaches. Instead of writing code, connect your data source and just ask in plain English: "Display average session duration by device as MM:SS." That’s it. Graphed handles the conversions for visualizing your data, freeing you to focus on insights instead of syntax issues.

Related Articles