cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rjs2
Resolver I
Resolver I

Duration M Query and Data tab

Hi,

 

I am having an issue with duration.  In M Query everything looks right and I have it set as duration 0.00:00:00, but once it comes into PBI I get nothing but Zeros.  When I hit the drop down filter I will see long decimal number  like 0.0118518518518519 etc.

 

I need to be able to find the average duration.  This is for call logs.  I can keep it as text in M Query and it will come accross in the duration format, buts a text and I cant calculate averages on a text field.

 

How do you process durations in PBI to calculate and measure average duration?

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@rjs2 Just to add to @az38 , what I believe you are seeing is fractions of a day. So 2 hours for example is 1/24 * 2. Minutes are 1/24/60 and seconds are 1/24/60/60. 

 

You may want to review this article as I am assuming that you will want to display them as distances at some point

https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

 

And this one may be useful as well:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@rjs2 Just to add to @az38 , what I believe you are seeing is fractions of a day. So 2 hours for example is 1/24 * 2. Minutes are 1/24/60 and seconds are 1/24/60/60. 

 

You may want to review this article as I am assuming that you will want to display them as distances at some point

https://community.powerbi.com/t5/Quick-Measures-Gallery/Chelsie-Eiden-s-Duration/m-p/793639#M389

 

And this one may be useful as well:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Duration-to-Seconds-Converter/m-p/342279#M92


@ me in replies or I'll lose your thread!!!
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Learn Power BI 2nd Edition
az38
Super User
Super User

Hi @rjs2 

I do not see a straight way to convert M-duration to DAX (maybe I'm missing smth)

As you did not provide more data model details - have a look at @Greg_Deckler solution https://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Helpful resources

Announcements
June 2022 update 768X460.jpg

Check it out!

Click here to read more about the June 2022 updates!

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power BI Dev Camp Session 23 768x460.jpg

Check it Out!

Mark your calendars and join us on Thursday, June 30 at 11a PDT for a great session with Ted Pattison!

June 20 episode 7 with aka link 768x460.jpg

The Power BI Community Show

Join us on June 20 at 11 am PDT when Kim Manis shares the latest on Azure Synapse analytics, the Microsoft Intelligent Data Platform, and notable Power BI Updates from Microsoft Build 2022.

Top Solution Authors