cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
VictorFR04 Frequent Visitor
Frequent Visitor

How to deal with Durations

Hi everyone.

 

I have some issues dealing with durations. For example, I have a column with the seniority of a worker in the format "X y. Ym" representing X number of years and Y number of months (ex: 2y. 4m). How can I transform this column to make it a duration ? PBI doesn't detect "y" as a year and "m" as a month. 

 

Also how to change the format of a duration into days, hours or minutes ? When you change a column with numbers into a duration, it automatically converts the number in minutes and I don't see how to change it to make it shaped as days, hours or minutes 

 

Thank in advance for your help 🙂 

 

Victor

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User IV
Super User IV

Re: How to deal with Durations

@VictorFR04 solution is attached, lot of transformation is done to get the final result. Thought process is to get year and month inseperate columns and then it is easier to calculate any unit.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

5 REPLIES 5
Super User IV
Super User IV

Re: How to deal with Durations

@VictorFR04 not fully clear if you data is in text or number y.m and what you want to convert this into?






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





VictorFR04 Frequent Visitor
Frequent Visitor

Re: How to deal with Durations

The data is in text format like below :

 

2y.

1y. 3m.

1y. 3m.

3m.

3y. 2m.

4y.

3m.

3y.

7y. 3m.

1y. 11m.

 

I want Power BI to convert those data as duration. But when I try it shows errors. 

Super User IV
Super User IV

Re: How to deal with Durations

@VictorFR04 when you say duration, what does that means? Hours/Minutes/Seconds/Week/Days???






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





VictorFR04 Frequent Visitor
Frequent Visitor

Re: How to deal with Durations

@parry2k In Months would be good for those kind of data, because it goes from 1 months to several years. So how do I convert text/number data type to months data type ? 

 

But I would also be interested in knowing how to convert numbers into days, hours and minutes. 

 

I was saying "duration" because t's one of the data type suggested by Power BI

 

Thank you

Highlighted
Super User IV
Super User IV

Re: How to deal with Durations

@VictorFR04 solution is attached, lot of transformation is done to get the final result. Thought process is to get year and month inseperate columns and then it is easier to calculate any unit.






Did I answer your question? Mark my post as a solution.

Proud to be a Datanaut! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





View solution in original post

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

Power BI Desktop Update - February 2020

Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors