Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
cmackay
New Member

Google Analytics time duration formatting issue

Hi guys,

 

We are connecting Power BI Desktop to the Google Analytics online service, and are having an issue with the duration fields (e.g. Avg. Time on Page).  On Google Analytics this is in the format HH:MM:SS, however when we pull this field back into the BI report it gives a decimalised format.

 

An example of this is a time of 00:00:18 is showing on the BI report as 0.00431.

 

We've created a DAX formula to try converting this...

Duration = MOD(MOD('Secure Website Data (2)'[Avg. Time on Page],3600),60)

 

...however it is coming up with the same decimalised value.

 

Could anyone please tell us how the 0.00431 value in Power BI relates to the time duration in GA?

 

Thanks in advance for your help.

 

Calum

 

1 ACCEPTED SOLUTION
v-caliao-msft
Employee
Employee

Hi @cmackay,

 

What's the data type that column? You can change the data type to Time.

Capture.PNGCapture1.PNG

Regards,

Charlie Liao

View solution in original post

3 REPLIES 3
v-caliao-msft
Employee
Employee

Hi @cmackay,

 

What's the data type that column? You can change the data type to Time.

Capture.PNGCapture1.PNG

Regards,

Charlie Liao

tommcmaster
Frequent Visitor

https://powerbi.microsoft.com/en-us/documentation/powerbi-desktop-data-types/

 

Duration is the data type used when we first import our data and can view it as a type before we load the data. From there, Duration is converted into a decimal which we need to convert back.

 

Tom.

Greg_Deckler
Super User
Super User

See my blog post here:

http://community.powerbi.com/t5/Community-Blog/Aggregating-Duration-Time/ba-p/22486

 

Also vote for a true time duration in Power BI Desktop here:

https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/8814178-field-of-duration-type


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors