Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
How can I convert decimal to duration format?
response time | target response time |
00:30:00 | 2,50 |
01:00:00 | 0,433 |
02:00:00 | 1,133 |
I want to convert the column "target response time" to the format of the column "response time".
Example: 2,50 must be converted to 02:30:00
Thank you.
Solved! Go to Solution.
duration = [target response time] / 24
cast the calculated column to type "Time"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
Hi @anlu20 ,
Can you let me know whether this answer worked for you or not please?
If it worked ok, please mark as the solution to help people with similar problems find the answer quicker.
Best Regards,
Eyelyn Qin
Hi @anlu20 ,
You could try the following formula to create column:
Time Column =
VAR _totalseconds = [target response time] * 3600
VAR _hour =
INT ( [target response time] )
VAR _min =
INT ( ( _totalseconds - _hour * 3600 ) / 60 )
VAR _sec = _totalseconds - _hour * 3600 - _min * 60
RETURN
TIME ( _hour, _min, _sec )
After change the data type and format type, the final output is shown below:
Best Regards,
Eyelyn Qin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
duration = [target response time] / 24
cast the calculated column to type "Time"
Thanks to the great efforts by MS engineers to simplify syntax of DAX! Most beginners are SUCCESSFULLY MISLED to think that they could easily master DAX; but it turns out that the intricacy of the most frequently used RANKX() is still way beyond their comprehension! |
DAX is simple, but NOT EASY! |
This worked for me. Now, I need to figure how to get them to return a sum in a Matrix. Currently, I cannot select sum of the duration in a Matrix. It only allows me to select first or count.
@anlu20 Maybe:
Column = FORMAT(INT([Column1]),"00") & ":" & FORMAT(([Column1] - INT([Column1])) * 60,"00") & ":00"
User | Count |
---|---|
91 | |
73 | |
68 | |
63 | |
55 |
User | Count |
---|---|
99 | |
88 | |
73 | |
60 | |
58 |