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.
Hi,
I have data set in Excel. It includes one column in total time. When I calculate the sum of the total time it gives me
242:27:07 |
But when i get that sheet into Power BI and get the sum of the total time it will give me following,
I want to know how to change that. If I can show it in "DD:HH:MM: SS" it will be fine. Also if i can show it in "HHH:MM: SS" it will be also fine. How can I get that in Power BI?
Regards,
Cham
Hi @cham ,
Based on my test, you could refer to below steps:
Sample data:
Create below measure:
Measure = var a=SUMX('Table1',HOUR('Table1'[Time])*3600+MINUTE('Table1'[Time])*60+SECOND('Table1'[Time])) return RIGHT ( "0" & INT ( a / 3600 ), 2 ) & ":" & RIGHT ( "0" & INT ( ( a - INT (a / 3600 ) * 3600 ) / 60 ), 2 ) & ":" & RIGHT ( "0" & MOD (a , 3600 ), 2 )
Result:
You could also download the pbix file to have a view.
Regards,
Daniel He
Hi,
This is not correct. Please check the below screenshot. When I got the SUM in Excel it shows me different total time. When I get the SUM in power BI it shows me different total time.
And aslo the the measure you used shows different total time. Can you explain this?
Hi @cham ,
What is your formula in your excel, it could work on my side:
In Power BI, it will transform the time to date automatically, it is by design, so I used the measure to show the sum of the time.
Sorry for my carelessness, I have modified my formula:
Regards,
Daniel He
Hi,
Normally when i click on user it will show me the correct total time of that particular user.
But when I SUM total time it will not show me the correct total. When I get the SUM of the total in Excel it will show me below total. I think Power BI is not showing like that because of the format. So, how can I get the correct total time in Power BI?
After i use your formula it will give me below screen shot (Measure 2)
Hi @cham ,
I could not figure which oucome you want to get:
The first one:
Or the second one:
I could give you all of the measure:
The first one:
Measure 2 = SUM(Table1[Time])
The second one:
Measure = var a = SUMX('Table1',HOUR('Table1'[Time])*3600+MINUTE('Table1'[Time])*60+SECOND('Table1'[Time])) return RIGHT ( "0" & INT ( a / 3600 ), 2 ) & ":" & RIGHT ( "0" & INT ( ( a - INT (a/ 3600 ) * 3600 ) / 60 ), 2 ) & ":" & a-INT ( ( a - INT (a / 3600 ) * 3600 ) / 60 )*60-(RIGHT ( "0" & INT ( a / 3600 ), 2 ))*3600
Result:
You could also download my pbix and excel file to have a try.
Regars,
Daniel He
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 |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |