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
YBZ
Helper III
Helper III

error converting text to date

Hi all,

 

I have an error with below sample data to convert a text column (Period) to a date format (Date period).

 

PeriodDate period
004.202101.04.2021
005.202101.05.2021
006.202101.06.2021

 

The Date Period I retrieved via following formula : 
Date Period = CONCATENATE("01.";right('DataFile'[Period];7))

 
Now when I would like to convert the Date Period column to date (dd.mm.year), it says that it cannot convert the value to Date format.
 
Any support is much appreciated,
 
Kind regards
1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@YBZ Perhaps try:

Date column =
  VAR __Day = LEFT([Date period],2)
  VAR __Month = MID([Date period],4,2)
  VAR __Year = RIGHT([Date period],4)
RETURN
  DATE(__Year,__Month,__Day)

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@YBZ Perhaps try:

Date column =
  VAR __Day = LEFT([Date period],2)
  VAR __Month = MID([Date period],4,2)
  VAR __Year = RIGHT([Date period],4)
RETURN
  DATE(__Year,__Month,__Day)

 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

thanks Greg, it works! 🙂

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