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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
ShubhamBarnwal
Frequent Visitor

Convert String to Date using Power Query editor

I am trying to add a column using below formula in power query editor:

 

Variance = Int32.From(Date.From([BaselineFinishDate])-Date.From([ActualFinishDate]))

 

Below is the output:

Capture.JPG

Earlier it was working fine. But now somethings's wrong. Need help to fix it. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @ShubhamBarnwal,

What’s the data type of column BaselineFinishDate and ActualFinishDate? Date or Text type?

The "variance" column worked normally before as you wrote in the case, but something went wrong now. It may be due to a date format problem. Please try to update the proper date format for this 2 columns by the following steps:

1. Select the related column, right click (Change Type --> Using Locale...)

changetype_1.jpg

2. Update with the proper format

  changetype_2.jpg

You can check this documentation for the full details.

 

Best Regards

Rena

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @ShubhamBarnwal,

What’s the data type of column BaselineFinishDate and ActualFinishDate? Date or Text type?

The "variance" column worked normally before as you wrote in the case, but something went wrong now. It may be due to a date format problem. Please try to update the proper date format for this 2 columns by the following steps:

1. Select the related column, right click (Change Type --> Using Locale...)

changetype_1.jpg

2. Update with the proper format

  changetype_2.jpg

You can check this documentation for the full details.

 

Best Regards

Rena

amitchandak
Super User
Super User

By using Date.From, first create a new column and check dates are coming correct.

Also if you can use dax. Then, if these are detected as date you can use datediff.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors