Forum Discussion
Show Duration Based on Time Spent
- Anonymous5 years ago
Hi Anonymous ,
You can use measure.
The calculated column will not change according to the selection of the slicer.
1. Create measure.
SumTime_meausre = VAR TotalSeconds = SUMX( 'IT Productivity Measurements', HOUR( 'IT Productivity Measurements'[Time Spent] ) * 3600 + MINUTE( 'IT Productivity Measurements'[Time Spent] ) * 60 + SECOND( 'IT Productivity Measurements'[Time Spent] ) ) VAR Days = TRUNC( TotalSeconds/3600/24) VAR Hors = TRUNC( (TotalSeconds-Days*3600*24 )/3600 ) VAR Mins = TRUNC( MOD( TotalSeconds,3600 )/60 ) VAR Secs = MOD( TotalSeconds, 60 ) RETURN IF(DAYS=0,"",IF(DAYS>1,DAYS&"days ",Days&"day"))&IF(Hors<10,"0"&Hors,Hors)&":"&IF(Mins<10,"0"&Mins,Mins)&":"&IF(Secs<10,"0"&Secs,Secs)2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Anonymous ,
Which Total you are referring to has not changed, whether you add the all() function to your measure to exclude other groups, and judge whether the relationship between the table and the table is correct.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data. If it is really inconvenient, measure sharing is also possible.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
https://app.box.com/s/13r54y783ayrre0kpqa5qcjk7p4h04uw
https://app.box.com/s/q1pox9f53qa7cb5sx59lqb3260i716sj
Above is the Excel table and PowerBI chart. The Total Duration box on the PBI chart does not change the Total Duration when I select one or multiple Technicians. It always shows 2 days 03:32:00. The previous example earlier in the post is the original. I trimmed the content down for the purpose of sharing this data.