Hello!
I have a report from our LMS showing viewing minutes as a decimal. I would like to create a new column that converts the decimal minutes to a duration where I see the total duration per course as well.
I have tried various suggested measures as well and got a duration to show, but then I wasn't able to get a total.
Any suggestions will be so appreciated.
In Excel it looks like this:
This is where I can get to inside my Power BI file:
The Viewing duration is based on a measure:
Solved! Go to Solution.
@Lisa-Eagle Maybe:
VAR seconds = ROUND( MOD ( MOD ( total, 3600 ), 60 ), 2 )
@Greg_DecklerI am having an issue with longer durations.
I tried to adapt the measure as follows but it didn't work. I would like the hours to not show more than 24hrs and for the days number to adapt accordingly.
Any ideas what I can try?
Thanks
Lisa Taylor
@Greg_Deckler I am still experiencing some issues with my duration and hoping you can point me in the right direction.
Issue 1 is that I would like to adapt the measure to only show a total of 24 hours as there are 24 hours in a day.
When I try to show a total duration I get the following:
Issue 2 is if I select to filter my table by group my duration measure is not maintained and I only get blanks dhms.
Current duration measure is:
@Lisa-Eagle Chelsie Eiden's Duration - Microsoft Power BI Community
@Lisa-Eagle Since that is a Column instead of a Measure, ditch the SUM in your Duration variable and just reference the column directly.
@Greg_Deckler thank you for your help thus far. I've managed to get the correct duration to display using your code from 2016.
See below screenshot. My question is now how can I show a sum of this column similar to the total shown under viewing minutes in my table.
You are a life saver, thanks again.
@Lisa-Eagle First, please vote for this idea: https://ideas.powerbi.com/ideas/idea/?ideaid=082203f1-594f-4ba7-ac87-bb91096c742e
This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376
Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:
https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907
Also: https://youtu.be/uXRriTN0cfY
And: https://youtu.be/n4TYhF2ARe8
@Greg_Deckler thank you for sharing those links. I so wish this totals issue was easier.
I have managed to get a total duration to show using the measure in below image. This is the closest I have gotten to what I would like to visualise. Only challenge now is how to adapt this measure so that seconds is rounded up to 2 places. Any ideas on that one please?
@Lisa-Eagle Maybe:
VAR seconds = ROUND( MOD ( MOD ( total, 3600 ), 60 ), 2 )
Thank you @Greg_Deckler that worked. I managed to adapt my measure to include days as well and used roundup for the seconds. Pretty cool. I am very grateful to you and this forum.
Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!