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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
i_stanescu_ro
Regular Visitor

Change number into date

Hi guys

 

I have a column with numbers with this format:

 

19990927

 

I need to change it to a date format, like this: 09.27.1999 or 27.09.1999 or something like this..

 

Can I pls ask for your help?

 

 

Thanks so much for your time!

1 ACCEPTED SOLUTION
Arul
Super User
Super User

@i_stanescu_ro ,

try this in calculated column,

New Date (Calculated Column) = 
VAR _year = LEFT(Test[Date],4)
VAR _month = MID(Test[Date],5,2)
VAR _day = RIGHT(Test[Date],2)
VAR _date = DATE(_year,_month,_day)
RETURN _date




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


View solution in original post

4 REPLIES 4
Arul
Super User
Super User

@i_stanescu_ro ,

try this in calculated column,

New Date (Calculated Column) = 
VAR _year = LEFT(Test[Date],4)
VAR _month = MID(Test[Date],5,2)
VAR _day = RIGHT(Test[Date],2)
VAR _date = DATE(_year,_month,_day)
RETURN _date




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!


LinkedIn


Thanks so much!

Fowmy
Super User
Super User

@i_stanescu_ro 

Create a calculated column, suppose your data is in a column called  TextData

var __Date = TABLENAME[TEXTDATA]

return

	DATE( INT(LEFT(__Date,4)) ,  INT(MID(__Date,5,2)) ,  INT(RIGHT(__Date,2)) )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Thanks so much!

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors