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
sabeensp
Helper IV
Helper IV

Convert whoel number to Date

Hello I have a column with Whole number like 20190106, when I try to convert that to Date it give me an error. How can I covert above whole number to YYYY/MM/DD format?

 

Thanks

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sabeensp 

 

Did you try adding M code like this?

 

Capture 4.PNG

 

 

 

Or you can also try this new column:

Column = Date(Left([data],4),Right(left([data],6),2),right([data],2)

and then change the data type of new column to Date

 

Let me know if thsi works.

 

Thanks,

Tejaswi

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @sabeensp ,

 

Take a look at this post. The issue is already resolved in this post.

 

https://community.powerbi.com/t5/Desktop/date-from-yyyymmdd-stored-as-whole-number/td-p/92689

 

Thanks,

Tejaswi

@Anonymous  M code not working for me somehow, when I add a new calcualted column. Is there another way?

Anonymous
Not applicable

Hi @sabeensp ,

 

There are two Solutions in this post.

 

Did you try the second one. Hope that works for you.

 

Thanks,

Tejaswi

Anonymous
Not applicable

Hi @sabeensp 

 

Did you try adding M code like this?

 

Capture 4.PNG

 

 

 

Or you can also try this new column:

Column = Date(Left([data],4),Right(left([data],6),2),right([data],2)

and then change the data type of new column to Date

 

Let me know if thsi works.

 

Thanks,

Tejaswi

@Anonymous  problem with the 2nd solution is that I have over 15 Date columns, divide them into YY, MM, DD would result in 45 columns. I was hoping for some DAX formula to convert

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