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! Learn more

Reply
Anonymous
Not applicable

Date from TEXT

I have a date column on CSV file where dates are written in this format 13012022

I want to convert to date so that i can select date type and can add slicer on Power BI. Please help.

1 ACCEPTED SOLUTION
Tahreem24
Super User
Super User

@Anonymous Try this DAX Column:

Date Column =
VAR Month_ = MID('Table'[Date],3,2)
VAR Day_ = LEFT('Table'[Date],2)
VAR Year_ = RIGHT('Table'[Date],4)
RETURN DATE(Year_,Month_,Day_)
 
Capture.JPG
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

View solution in original post

3 REPLIES 3
Tahreem24
Super User
Super User

@Anonymous Try this DAX Column:

Date Column =
VAR Month_ = MID('Table'[Date],3,2)
VAR Day_ = LEFT('Table'[Date],2)
VAR Year_ = RIGHT('Table'[Date],4)
RETURN DATE(Year_,Month_,Day_)
 
Capture.JPG
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
ALLUREAN
Solution Sage
Solution Sage

Hi, @Anonymous 

This sample is using Power Query to do the transformations.

https://www.dropbox.com/s/4b6n3ofqpujnfc4/text%20to%20date%20%28allure-analytics.com%29.pbix?dl=0

 

Added also using DAX calculated column

NewDateDAX = LEFT('Table'[Text],2) &"-"& MID('Table'[Text],3,2)&"-"& RIGHT('Table'[Text],4)
 

 




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


https://allure-analytics.com/
https://www.youtube.com/channel/UCndD_QZVNB_JWYLEmP6KrpA
https://www.linkedin.com/company/77757292/

Proud to be a Super User!




Anonymous
Not applicable

maybe you can try it by Calculated column:

DateNew = MID[date]54)&"-"&MID[date]32)&"-"&MID[date]12)

jak11_0-1644561721414.png

 

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