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
kzielinska
Helper I
Helper I

Date YYYYMMDD to DD/MM/YYYY & filtering

Hi,

 

I have a date folumn with format YYYYMMDD. I tried to change its format to dd/mm/yyyy by creating new column using the dax formula:

Date1 = DATE(LEFT([column],4), MID([column], 5, 2), RIGHT([column], 2)),
 
but it doesn't work due to this error: Cannot convert value 'null' of type Text to type Integer.
I tried to replace nulls with the measure: 
Date if blank = IF(ISBLANK([column]),0,[column]),
but it does not work.
 
Does anyone know fow to fix this?
 
3 REPLIES 3
ppm1
Solution Sage
Solution Sage

If your column is type text, you can do it in the query editor with a custom column with this expression.

 

= Date.ToText(Date.From([Date]), "dd/MM/yyyy")

 

Pat

Microsoft Employee
amitchandak
Super User
Super User

@kzielinska , try like

 

Date if blank = IF(ISBLANK([column]),blank() ,DATE(LEFT([column],4), MID([column], 5, 2), RIGHT([column], 2)) )

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

I get this error: An argument of function 'DATE' has the wrong data type or the result is too large or too small.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.