Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I'm having some trouble getting a measure to pick up a column. I'm wanting to convert my Duration Minutes to hh:mm.
Getting the below error, which seem to suggest there is something wrong with my Duration column. I've been able to use it in the reporting without problem, but can't use it in a measure.
Any help would be appriciated
Solved! Go to Solution.
Hi @KatsuKun
In measures, columns always have to be in a function.
SelectedValue(table[Column]) lets you return a single value IF that column is being used in the visual.
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Hi @KatsuKun ,
Based on my testing, if creating a measure to display time, you need to use function to get the column values.
Measure =
var _duration = SELECTEDVALUE('Table'[Duration Minutes])
VAR Hours = INT(_duration / 60)
VAR Minutes = MOD(_duration, 60)
RETURN
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00")
If you want to create a new column to display the time, using your writing dax can success.
Column =
VAR Hours = INT([Duration Minutes] / 60)
VAR Minutes = MOD([Duration Minutes], 60)
RETURN
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00")
You can also view the following documents to learn more information.
Measures in Power BI Desktop - Power BI | Microsoft Learn
Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Learn
SELECTEDVALUE function - DAX | Microsoft Learn
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @KatsuKun ,
Based on my testing, if creating a measure to display time, you need to use function to get the column values.
Measure =
var _duration = SELECTEDVALUE('Table'[Duration Minutes])
VAR Hours = INT(_duration / 60)
VAR Minutes = MOD(_duration, 60)
RETURN
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00")
If you want to create a new column to display the time, using your writing dax can success.
Column =
VAR Hours = INT([Duration Minutes] / 60)
VAR Minutes = MOD([Duration Minutes], 60)
RETURN
FORMAT(Hours, "00") & ":" & FORMAT(Minutes, "00")
You can also view the following documents to learn more information.
Measures in Power BI Desktop - Power BI | Microsoft Learn
Tutorial: Create calculated columns in Power BI Desktop - Power BI | Microsoft Learn
SELECTEDVALUE function - DAX | Microsoft Learn
Best Regards,
Wisdom Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @KatsuKun
In measures, columns always have to be in a function.
SelectedValue(table[Column]) lets you return a single value IF that column is being used in the visual.
If you are happy with this answer please mark as a solution for others to find !
Kudos are always appreciated! Check out our free Power BI video courses.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 70 | |
| 50 | |
| 42 | |
| 40 |