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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
heejinyune
Frequent Visitor

How to convert duration column to date/time column

Hello community! 

 

I want to convert duration (time) column to the date/time column with some calculation.

For example, my table is like this:

heejinyune_0-1666889115527.png

 

once model build start the step 1 happened with those duration and move on to next step. When the model finished all the 4 steps it will finish the operation and recorded the date/time in the model_build_end column. 

 

I wanted to create Gantt chart with this table. To show every steps duration within the timeframe. 

However, I couldn't create Gantt chart with multiple duration so want to convert duration with datetime data type.

If anyone knows how to create query like this? 

For example, step 1 column data should be convert 2022/10/22 13:21:00 pm + 03:22:32 so it have to be 2022/10/22 16:43:32pm.

 

Thank you! 

 

1 ACCEPTED SOLUTION
Bifinity_75
Solution Sage
Solution Sage

Hi heejinyune, try this:

 

1.- Split column "Step 1" by delimeter ":"

Bifinity_75_0-1666906249536.png

2.- The result is something like this:

Bifinity_75_1-1666906313736.png

3.- Change the result to format number:

Bifinity_75_2-1666906410319.png

4.- Create a custon column with this formula:

Bifinity_75_3-1666906457029.png

5.- Result:

Bifinity_75_4-1666906572457.png

6- Apply the same rules to another Steps

 

Best regards

 

View solution in original post

1 REPLY 1
Bifinity_75
Solution Sage
Solution Sage

Hi heejinyune, try this:

 

1.- Split column "Step 1" by delimeter ":"

Bifinity_75_0-1666906249536.png

2.- The result is something like this:

Bifinity_75_1-1666906313736.png

3.- Change the result to format number:

Bifinity_75_2-1666906410319.png

4.- Create a custon column with this formula:

Bifinity_75_3-1666906457029.png

5.- Result:

Bifinity_75_4-1666906572457.png

6- Apply the same rules to another Steps

 

Best regards

 

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.