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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

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
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.