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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Fools_Gold
Helper I
Helper I

How to extract this text to a date in a column

Hello,

I cant seem to convert this to a date. The column goes something like below:

"ForecastSnap2024-07-01 00:00:00"
"ForecastSnap2024-08-01 00:00:00"
"Sales"
"ForecastSnap2024-09-01 00:00:00"
"Sales"
"ForecastSnap2024-10-01 00:00:00"
 
What I want:
2024-07-01
2024-08-01
"" - Sales should be blank
2024-09-01
"" - Sales should be blank
2024-10-01
 
Then I want convert it to a date, excluding the blank ones.
 
Thanks,
 
Fools_Gold
1 ACCEPTED SOLUTION
Gabry
Super User
Super User

Hello,

does it always starts with the string "Forecastsnap"? If yes, it's easy, add a personalyzed column 

if Text.StartsWith([ColumnName], "ForecastSnap") then Text.Middle([ColumnName], 12, 10) else null

View solution in original post

3 REPLIES 3
Gabry
Super User
Super User

Hello,

does it always starts with the string "Forecastsnap"? If yes, it's easy, add a personalyzed column 

if Text.StartsWith([ColumnName], "ForecastSnap") then Text.Middle([ColumnName], 12, 10) else null

It worked! Thank you!

😉

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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