The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello, I am attempting to convert this decimal column into an hours and minutes column.
My formula below works well, but creates the column as a text column not a number column.
I need to be able to sum these columns.
Thank you for your help!
Solved! Go to Solution.
Hi @dubya ,
I create a table as you mentioned.
Then I think you can change your DAX code, it will give you Date/Time type. You can change format as you like.
Column =
VAR _hrs =
QUOTIENT ( '12 1/2'[Average Adjusted Hours], 1 )
VAR _mins =
MOD ( '12 1/2'[Average Adjusted Hours] * 60, 60 )
RETURN
TIME ( _hrs, _mins, 0 )
Next I think you can create another calculated column.
Total Adjusted Hours =
VAR TotalMinutes =
SUMX ( '12 1/2', '12 1/2'[Column] * 60 )
VAR Hours =
QUOTIENT ( TotalMinutes, 60 )
VAR Minutes =
MOD ( TotalMinutes, 60 )
RETURN
TIME ( Hours, Minutes, 0 )
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Easy enough,
Expertise = List.Accumulate( {Days as from Today}, {Skills and Knowledge}, (Current, Everyday) => Current & Day.LearnAndPractise(Everyday) ) |
If you want to be able to do math on these values then you need to keep them as is. The format can be applied at the last second (ie as a different measure) before your display the result.
Thank you,
Are you able to provide additional detail as to had to add the formula as a measure?
Hi @dubya ,
I create a table as you mentioned.
Then I think you can change your DAX code, it will give you Date/Time type. You can change format as you like.
Column =
VAR _hrs =
QUOTIENT ( '12 1/2'[Average Adjusted Hours], 1 )
VAR _mins =
MOD ( '12 1/2'[Average Adjusted Hours] * 60, 60 )
RETURN
TIME ( _hrs, _mins, 0 )
Next I think you can create another calculated column.
Total Adjusted Hours =
VAR TotalMinutes =
SUMX ( '12 1/2', '12 1/2'[Column] * 60 )
VAR Hours =
QUOTIENT ( TotalMinutes, 60 )
VAR Minutes =
MOD ( TotalMinutes, 60 )
RETURN
TIME ( Hours, Minutes, 0 )
Best Regards
Yilong Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.