Forum Discussion

Jtischler's avatar
Jtischler
Helper I
3 years ago

Duration not summing up correctly

Hello,

 

I am extremely new to PBI, and am trying to support on of my admins in a dashboard calculation for learning hours that is incorrect.  Our use case is to sum up total learning hours based on HH:MM:SS duration of training in a CSV export from LMS that is imported to PBI.  When in excel and summing up it reflects approx 36k hours but in the PBI measure on the dashboard it only shows 25k.  We have exhausted various sites as well as the forum here and have concluded that duration over 24 hours is not tabulating correctly into the total sum of duration.  We have tried various code snips but have not been able to get this to reflect correctly in the dashboard. PLEASE HELP!!!!

 

Current code snippet:

 

VAR _sum=sum(Dashboard_All_Course_Completion[Duration (HH:MM) for Reporting])*86400

VAR _h=int(_sum/3600)

VAR _m=int((_sum-_h*3600)/60)

VAR _s=int(_sum-_h*3600-_m*60)

return _h.

 

If anyone is kind enough to respond please keep in ming I have almost zero experience with PBI (Plenty in excel and Power apps and even some coding classes) so treat me like a complete noob 😂 

3 Replies