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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

How to convert number to date?

So I have a column that I import to my dataset that comes in as "201701" or "201702" etc. I am trying to turn this column into the end of month date for the respective month. So 1/31/17 for the first and 2/28/17 for the second. I know I can split the column by number of characters to get a column with "2017" and another column  with "01" or "02". However, I'm stumped where to go from here to make these columns the date I want. I don't think I can use any date functions since these columns are recognized as numbers. And if I convert the columns to date, it just makes them a weird date.

 

Any ideas or is it possible to convert this column into a column that I'm looking for?

 

Thanks

1 ACCEPTED SOLUTION
jthomson
Solution Sage
Solution Sage

Could you not try making a column using EOMONTH(DATE([theyearcolumnyoumade],[themonthcolumnyoumade],1))?

View solution in original post

2 REPLIES 2
jthomson
Solution Sage
Solution Sage

Could you not try making a column using EOMONTH(DATE([theyearcolumnyoumade],[themonthcolumnyoumade],1))?

Anonymous
Not applicable

That did the trick. Thanks! Didn't think the date functions would work.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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