Power Query Convert Minutes to Hours: Easy Steps
The calculator for this page is switched off while it is checked. The formula is below, and the worked example in the article shows how to use it by hand.
To convert minutes to hours in Power Query, divide the minutes column by 60 using a custom column or transform the existing column. For example, 150 minutes becomes 2.5 hours. This guide shows you the exact steps, how to format the result as hours and minutes, and how to handle large datasets without errors.
Formula
The basic conversion formula is:
- Hours = Minutes ÷ 60
- Minutes = Hours × 60
In Power Query, you apply this using the M language. If your column is named Minutes, the formula in a custom column is [Minutes] / 60. The result is a decimal number, where the integer part is the whole hours and the decimal part is the fraction of an hour. For example, 90 minutes gives 1.5 hours, meaning 1 hour and 30 minutes.
If you want to display the result as a duration (like 1:30), you can format it as text or use the Duration type, but Power Query’s default division yields a plain number.
Worked Example
Let’s convert 150 minutes to hours using the default values from the calculator above.
- Open Power Query Editor (in Excel: Data > Get Data > From Other Sources > Blank Query; in Power BI: Home > Transform Data).
- Create a new column: Add Column > Custom Column. Name it
Hoursand enter the formula[Minutes] / 60. - Click OK. The new column shows 2.5 for 150 minutes.
- To display as “2h 30m�, add another custom column with the formula shown in the calculator block. For 150 minutes, it returns “2h 30m�.
If you prefer to replace the original column, select the Minutes column, go to Transform > Standard > Divide, and enter 60. That changes the column in place.
How to Choose the Right Method
There are three common ways to convert minutes to hours in Power Query, and the best one depends on what you need the output for:
- Decimal hours (e.g., 2.5) – Use division by 60. This is ideal for calculations, such as multiplying by an hourly rate.
- Text like “2h 30m� – Use the custom column formula that concatenates whole hours and remaining minutes. Good for reports where readability matters.
- Duration type (e.g., 2:30:00) – Convert the minutes to a duration by creating a column with
#duration(0,0,Minutes,0)where Minutes is your column name. This is useful for time arithmetic in Power BI, but it may not display as expected in Excel.
For most users, the decimal method is simplest and most flexible. If you need to show hours and minutes separately, extract the whole hours with Number.RoundDown([Minutes]/60) and the remaining minutes with Number.Mod([Minutes],60).
Common Problems and Fixes
Here are typical issues you might run into when converting minutes to hours in Power Query:
- Column is text, not numbers – If your minutes column is stored as text, Power Query cannot divide it. Convert it first: select the column, go to Transform > Data Type > Whole Number or Decimal.
- Null or blank values – Dividing a null by 60 returns null. Use
if [Minutes] = null then null else [Minutes] / 60in the custom column formula. - Negative minutes – The formula works, but the text format may show “-1h -30m� instead of “-1h 30m�. To handle negatives, use
Number.Absfor the remainder and add a minus sign manually. - Rounding errors – When converting to text, rounding the minutes to whole numbers may cause 59.99 to show as 60m. Use
Number.Roundcarefully or useNumber.RoundDownfor the remainder. - Large datasets – Adding a custom column with a formula is efficient even for millions of rows, but avoid using
Text.Fromon huge numbers unless necessary.
Power Query vs. Excel Formulas
If you are working in Excel, you might wonder whether to use Power Query or a regular worksheet formula. Here’s a quick comparison:
- Excel formula – In a cell, you can write
=A2/60to get decimal hours, or=TEXT(A2/1440,"h:mm")to get a time format. This is immediate and works for small datasets. - Power Query – Better for data that is refreshed regularly, comes from external sources, or needs cleaning before conversion. It also keeps the transformation reproducible.
- When to use each – For a one-off calculation, use Excel. For a data pipeline or a large file, use Power Query.
Note that in Excel, a time value of 1 hour is stored as 1/24 of a day, so to convert minutes to a time, divide by 1440 (24*60). In Power Query, durations are handled differently, so the division by 60 is correct for decimal hours.
Frequently Asked Questions
How do I convert minutes to hours and minutes in Power Query?
Use a custom column with the formula Number.ToText(Number.RoundDown([Minutes]/60)) & "h " & Number.ToText(Number.Mod([Minutes],60)) & "m". For 150 minutes, this returns “2h 30m�. If you want a duration type, use #duration(0,0,[Minutes],0).
What is the difference between dividing by 60 and using Duration.From?
Dividing by 60 gives a decimal number (e.g., 2.5), which is easy to use in calculations. #duration(0,0,Minutes,0) creates a duration value that Power BI can display as 2:30:00, but it may not be compatible with all Excel features.
Can I convert minutes to hours in Power Query without a custom column?
Yes. Select the minutes column, go to Transform > Standard > Divide, and enter 60. This modifies the column in place. You can also use the “Replace Values� feature if you need to change the column type first.
Why does my result show 2.50 instead of 2:30?
Because dividing by 60 yields a decimal number. To display as a time, either format the column as a duration (using the Duration type) or create a text column with the “h� and “m� format. The decimal format is often preferred for calculations.
How do I handle minutes that are stored as text like “150 min�?
First, remove the “ min� suffix. In Power Query, you can use the Replace Values feature to remove “ min� (replace with nothing). Then change the column type to Whole Number. After that, apply the division by 60.
Does Power Query round the result automatically?
No, dividing by 60 gives a floating-point number. If you want a specific number of decimals, use the “Round� button in the Transform tab or wrap the formula in Number.Round([Minutes]/60, 2) for two decimals.
Related
Formula used
min | Minutes | 150 | 0 hrs | Hours (decimal) | min / 60 | 2 hrs_mm | Hours and Minutes (text) | Number.ToText(Number.RoundDown(min/60)) & "h " & Number.ToText(Number.Round(min - Number.RoundDown(min/60)*60)) & "m" | 0
Each line is one input (in, sel, list) or one result (out: label, unit, formula, decimals). How the calculators work
Method: the standard formula for this calculation, rounded as each result states. See how the calculators work or report an error.