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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
Lena85
Helper I
Helper I

Duration data type not converting in the PowerBI Desktop

Lena85_0-1669902187513.png

Hi!

 

I am trying to build lag analysis. For that, I have a view with timestamps and various lags between them. I so far did two things. 

 

-> calculated each lag into dd hh mm format using DAX, however these results are only valid on row level, and I am interested in averages. 

 

-> Changed the original column with a lag, into a duration type. I can then see, in power query, that for that given parcel, the duration is expressed in hours. See example of the first parcel, it shows 10h 11 min 36 sec. However, when closing and applying, after refreshing, the desktop report still shows the same lag as a fraction of a 24h (see on the left), 0.42. 

 

How do I convert into a duration format that is easily readable to the business and on which I can calculate averages?

 

Thank you,

Lena

1 ACCEPTED SOLUTION
v-yinliw-msft
Community Support
Community Support

Hi @Lena85 ,

 

I reproduce your question.

In the Power Query:

vyinliwmsft_0-1669973708631.png

In the table:

vyinliwmsft_1-1669973741738.png

You can change the type of the data like this:

vyinliwmsft_2-1669973785189.png

Then calculate the average:

Average = FORMAT(AVERAGE('Table'[Time]),"hh:mm:ss")

The result is:

vyinliwmsft_3-1669973934250.png

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Lena85
Helper I
Helper I

@v-yinliw-msft 

 

Thank you for your suggestion. However when I replicate it, I get the following error:

 

Lena85_0-1669978040115.png

Some of our lags have negative values as we calculate period from B - A, but sometimes, in our processes, the B can take place before A. I then cannot convert this to time. Is there any solution to this?

v-yinliw-msft
Community Support
Community Support

Hi @Lena85 ,

 

I reproduce your question.

In the Power Query:

vyinliwmsft_0-1669973708631.png

In the table:

vyinliwmsft_1-1669973741738.png

You can change the type of the data like this:

vyinliwmsft_2-1669973785189.png

Then calculate the average:

Average = FORMAT(AVERAGE('Table'[Time]),"hh:mm:ss")

The result is:

vyinliwmsft_3-1669973934250.png

Hope this helps you.

Here is my PBIX file.

 

Best Regards,

Community Support Team _Yinliw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.