Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Good day
I need help. I wrote a dax measure for calculating the total abseteesm time. The challenge i'm having is that when i display it is show less time where as i know that the total time should be a huge number.
E.g. instead of showing 1770:30:00 it displays 3:23:00 as the total time.
I don't know if it is a format or settings issue in power bi desktop.
Solved! Go to Solution.
Hi @Anonymous,
first of all, Power BI doesn't support duration data type, just time. Therefore I don't think so it is a good idea to sum up time values. Convert your times into count of minutes, sum them up and convert them back.
Then formating with "HH:mm:ss" is also not a good idea because it just take the part of a day, not a total count of hours.
Calculate minutes (or even seconds if needed) of every time, sum it up and format the result as you need.
Sum of minutes formatted = VAR sumOfMinutes = SUMX ( Table3; HOUR(Table3[Column1]) * 60 + MINUTE(Table3[Column1]) ) VAR totalHours = sumOfMinutes / 60 VAR minutes = MOD ( sumOfMinutes; 60 ) VAR formattedResult = FORMAT ( totalHours; 00 ) & ":" & FORMAT ( minutes; "00" ) RETURN formattedResult
Hi @Anonymous,
if it is ok for you and your question has been answered, please mark the answer as a solution.
Tough to say without data or at least calculations. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490
Hi @Anonymous,
first of all, Power BI doesn't support duration data type, just time. Therefore I don't think so it is a good idea to sum up time values. Convert your times into count of minutes, sum them up and convert them back.
Then formating with "HH:mm:ss" is also not a good idea because it just take the part of a day, not a total count of hours.
Calculate minutes (or even seconds if needed) of every time, sum it up and format the result as you need.
Sum of minutes formatted = VAR sumOfMinutes = SUMX ( Table3; HOUR(Table3[Column1]) * 60 + MINUTE(Table3[Column1]) ) VAR totalHours = sumOfMinutes / 60 VAR minutes = MOD ( sumOfMinutes; 60 ) VAR formattedResult = FORMAT ( totalHours; 00 ) & ":" & FORMAT ( minutes; "00" ) RETURN formattedResult
Can you help me to convert my entier value in to hh:mm:ss . right now i checked your variable and it worked and need to convert in to second
Hi @Nolock,
Thank you so much for your help.
I have then decided to just display the sum of total hours as whole number.
Hi @Anonymous,
if it is ok for you and your question has been answered, please mark the answer as a solution.
User | Count |
---|---|
125 | |
106 | |
99 | |
63 | |
62 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |