Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
110 | |
94 | |
81 | |
66 | |
58 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |