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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
sharpedogs
Advocate II
Advocate II

Time Duration - Help I'm lost...

Hi, 

The dataset I have reflects the below date/time format, along with the duration. When I input the data into PowerBi all three time columns end up with an AM or PM at the end and the duration doesn't correctly reflect the time between Start and End Session. 

 

I need a time chart of some sorts that shows peak times thorught the day for Application usage. I'm at a lose with respect to how I update the date/time fileds i have and then how i overaly the duration to show anything of value..

 

Please help 🙂  

 

 

UserSession_StartSession_EndDurationApplication
Test User 12/14/2020 8:59 AM2/14/2020 19:10 PM10:11:53 AMAdobe 
Test User 22/13/2020 7:44 AM2/13/2020 18:54 PM11:09:59 AMOffice
Test User 32/12/2020 7:54 AM2/12/2020 17:41 PM9:47:29 AMCitrix
Test user 42/11/2020 15:11 PM2/11/2020 19:01 PM 3:49:51 AMVisio

 

1 ACCEPTED SOLUTION
vivran22
Community Champion
Community Champion

Hello @sharpedogs,

 

In my experience, dealing with time values is quite tricky in Power BI/Query. I follow simple steps in Power Query to convert such values to ease out the calculation (converting it into number format)

 

For your sample data, I may recommend the following:

 

Convert the data type of the Duration field as Time:

 

step 1.png

 

Then convert it into Decimal Number:

 

2.png

 

Transform > Standard > Multiply by 24:

3.PNG

 

This will convert the time value of 10:11:53 as 10.19 hours

 

 

 

Another alternate route is to calculate it from Start & End session columns:

 

 

Add a custom column:

 

4.PNG

 

Change the type as Duration

 

5.png

 

Transform > Duration > Total Hours

 

6.png

 

Hope this will solve the purpose.

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

View solution in original post

2 REPLIES 2
vivran22
Community Champion
Community Champion

Hello @sharpedogs,

 

In my experience, dealing with time values is quite tricky in Power BI/Query. I follow simple steps in Power Query to convert such values to ease out the calculation (converting it into number format)

 

For your sample data, I may recommend the following:

 

Convert the data type of the Duration field as Time:

 

step 1.png

 

Then convert it into Decimal Number:

 

2.png

 

Transform > Standard > Multiply by 24:

3.PNG

 

This will convert the time value of 10:11:53 as 10.19 hours

 

 

 

Another alternate route is to calculate it from Start & End session columns:

 

 

Add a custom column:

 

4.PNG

 

Change the type as Duration

 

5.png

 

Transform > Duration > Total Hours

 

6.png

 

Hope this will solve the purpose.

 

Cheers!
Vivek

If it helps, please mark it as a solution
Kudos would be a cherry on the top 🙂

https://www.vivran.in/

Connect on LinkedIn

Greg_Deckler
Community Champion
Community Champion

Perhaps try switching your Duration column to a Duration data type in Power Query?



Follow on LinkedIn
@ 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!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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