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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Create a new date format column in SSAS based in a int column

Hi all 
I have a dimDateEntry with the format yyyymmdd , as integer. 
But now I need to add a new date format column in SSAS, with that date.
I already try the follow code that returns a error :   =FORMAT('Table'[dimDateEntry];"mm/dd/yyyy")
or even 
=DAY('Table'[dimDateEntry]) & "/" & MONTH('Table'[dimDateEntry]) & "/" & YEAR('Table'[dimDateEntry])


1 ACCEPTED SOLUTION
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Create a column with below code:-

Column = 
var _year = MID([Date],1,4)
var _month = MID([Date],5,2)
var _day = MID([Date],7,2)
return DATE(_year,_month,_day)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

1 REPLY 1
Samarth_18
Community Champion
Community Champion

Hi @Anonymous ,

 

Create a column with below code:-

Column = 
var _year = MID([Date],1,4)
var _month = MID([Date],5,2)
var _day = MID([Date],7,2)
return DATE(_year,_month,_day)

 

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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