Forum Discussion
Issues with Duration type
- Anonymous2 years ago
Hi MatH
This is because the Duration data type is not supported in Report view. It only exists in Power Query Editor currently.
The Data Type dropdown selection in Power Query Editor has two data types not present in Data View or Report View: Date/Time/Timezone and Duration. When you load a column with these data types into the Power BI model, a Date/Time/Timezone column converts into a Date/time data type, and a Duration column converts into a Decimal number data type. The decimal number represent a duration in Day unit.
Based on above, a common practice at present is to use DAX to convert the decimal number into hours or minutes or seconds for calculating the average/max/min/.... Then format the result into Text type to make them display similar to a time. But this practice has a problem if you want to display them in visuals which expects numeric values.
Or you can try another workaround from Chelsie Eiden's Duration - Microsoft Fabric Community. It resolved the above concern.
Hope this will be helpful.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!
Is this what you are looking for?
Not really, I'm happy for them to stay in HH:MM:SS formatting similar to a time on the clock. But I want to be able to report on these durations so we can know the average call length is X, the wait time is Y for example.
At the moment with them being times it's just giving me options like Earliest, or Latest on the card. I managed to get it to convert to duration by moving the type change as the file was loaded, this gave me what I wanted:
But when I close and apply the query it then converts them to a decimal number and breaks that duration. I can't understand why?
- Anonymous2 years agoNot applicable
Hi MatH
This is because the Duration data type is not supported in Report view. It only exists in Power Query Editor currently.
The Data Type dropdown selection in Power Query Editor has two data types not present in Data View or Report View: Date/Time/Timezone and Duration. When you load a column with these data types into the Power BI model, a Date/Time/Timezone column converts into a Date/time data type, and a Duration column converts into a Decimal number data type. The decimal number represent a duration in Day unit.
Based on above, a common practice at present is to use DAX to convert the decimal number into hours or minutes or seconds for calculating the average/max/min/.... Then format the result into Text type to make them display similar to a time. But this practice has a problem if you want to display them in visuals which expects numeric values.
Or you can try another workaround from Chelsie Eiden's Duration - Microsoft Fabric Community. It resolved the above concern.
Hope this will be helpful.
Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!