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

Get certified in Microsoft Fabric—for free! For a limited time, the Microsoft Fabric Community team will be offering free DP-600 exam vouchers. Prepare now

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
OCT PBI Update Carousel

Power BI Monthly Update - October 2024

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

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

October NL Carousel

Fabric Community Update - October 2024

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