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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.