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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
rajendraongole1
Power Participant
Power Participant

How to convert a date field from 2w,2d,-1d to proper date format

Hi All,

 

I have a table with field Current date and due date in the below format. I want to convert the data in the field due date to proper format.

 

As listed we have data like 2w (week), 2d, (days),3d (3 days) like that . we have to get the due date output should be from current date to due date 2d means next after 2 days date format. 

mm/dd/yyyy format

Any suggestion. Please let us know.

 

Like example 

 

Current DateDue DateExpected Date
11/10/202211/14/202211/14/2022
 nullnull
11/10/202212/14/202212/14/2022
 nullnull
 nullnull
11/10/20222w 3d12/12/2022
11/10/20222d11/12/2022
   
11/10/20222w 2d12/12/2022

 

 

 

1 ACCEPTED SOLUTION
mangaus1111
Solution Sage
Solution Sage

Hi @rajendraongole1 ,

see my pbi file. 

https://1drv.ms/u/s!Aj45jbu0mDVJi2da_Op1RvvBu_Ky?e=lAUscz

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

3 REPLIES 3
mangaus1111
Solution Sage
Solution Sage

Hi @rajendraongole1 ,

see my pbi file. 

https://1drv.ms/u/s!Aj45jbu0mDVJi2da_Op1RvvBu_Ky?e=lAUscz

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

daXtreme
Solution Sage
Solution Sage

Well, you have to parse the entry and extract the numbers. Then multiply them by the correct number of days (w = 7 days, d = 1) and then add to the start date. This should be done in Power Query.

Thanks for the update, I have tried with the parse the values in query editor. 

 

multiply with week for 7 and day with 1.

 

but not working out in my case. 

 

rajendraongole1_0-1669112271390.png

 

 

Any suggestions on this?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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