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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
snifer
Post Patron
Post Patron

join 2 columns

I got a table with one column the year YYYY and one column the month MM, how I can create a date column where there will bee MM/YYYY ( column created must be formatted as a date in order to use them

SAMEPERIODLASTYEAR function
1 ACCEPTED SOLUTION
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @snifer ,

Based on my test, you could refer to below steps:

Sample data:

1.PNG

Create below formula:

Column = CONCATENATE('Table2'[Month],CONCATENATE("/",'Table2'[Year]))

And change the format:

1.PNG

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @snifer ,


Could you please tell me if your problem has been solved? If it is, could you please mark the helpful replies as Answered to close this topic?

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I always prefer to do transformations like this in the Query editor for multiple reasons. You could approach this in multiple ways, here I will assume you dont have a day column and therefor map all to the first day in the month.

 

Go to the query editor:

- Create a custom column "Day" with this formula: "1" (you now have a column with value 1 in all rows)

- Highlight your Year, Month and Day columns in that order and under "Add Column" choose "Merge Columns", pick a custom separator "-" and apply. Name the new Column "Date".

- Format the new column as Date.

 

Hope that helps 🙂

 

v-danhe-msft
Microsoft Employee
Microsoft Employee

Hi @snifer ,

Based on my test, you could refer to below steps:

Sample data:

1.PNG

Create below formula:

Column = CONCATENATE('Table2'[Month],CONCATENATE("/",'Table2'[Year]))

And change the format:

1.PNG

 

Regards,

Daniel He

Community Support Team _ Daniel He
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!