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
MaBla2
New Member

How to get a date column from two separate columns containing year and month?

Hi there,

 

In my table I have two separate columns for [Year] and [Month]. There is no information about the day or any other date / time information in the table. What do I have to do to get a new column consisting of year and month that is supported by the Time Intelligence feature of Power BI?

 

I assume it isn't too hard to solve my problem but I just didn't get it working.

1 ACCEPTED SOLUTION
Sean
Community Champion
Community Champion

@MaBla2 This will depend on your regional setting so of you are in the US ( or your standard date is MM-DD-YY)

 

MM-DD-YYYY Column = 'Table'[Month] & "-1-" & 'Table'[Year]

This will result in a Column of Data Type: Text => go to Modeling tab => change the Data Type to Date

 

As you can see this will work regardless of whether the Month Column is number, abbreviation or full month name

just don't forget to change the Date Type

 

2016-10-21 - Create a DATE Column.png

 

Now if you use DD-MM-YY in your region just change the order

 

DD-MM-YYYY Column = "1-" & 'Table'[Month] & "-" & 'Table'[Year]

This will also result in a Text Column which you need to Change in the Modeling Tab the same way.

 

Hope this helps! Smiley Happy

 

 

 

 

View solution in original post

1 REPLY 1
Sean
Community Champion
Community Champion

@MaBla2 This will depend on your regional setting so of you are in the US ( or your standard date is MM-DD-YY)

 

MM-DD-YYYY Column = 'Table'[Month] & "-1-" & 'Table'[Year]

This will result in a Column of Data Type: Text => go to Modeling tab => change the Data Type to Date

 

As you can see this will work regardless of whether the Month Column is number, abbreviation or full month name

just don't forget to change the Date Type

 

2016-10-21 - Create a DATE Column.png

 

Now if you use DD-MM-YY in your region just change the order

 

DD-MM-YYYY Column = "1-" & 'Table'[Month] & "-" & 'Table'[Year]

This will also result in a Text Column which you need to Change in the Modeling Tab the same way.

 

Hope this helps! Smiley Happy

 

 

 

 

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.