cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Analytics4Life1
Regular Visitor

How to combine month and year columns into MM-YYYY

Hello,

 

I am still very new to Power BI and was playing around with some sample data today.

 

I have a Year column in YYYY format, and Date Number column (1= January, 12 = December). 

 

Could someone help me with the formula I would use to combine these two columns to get a MM-YYYY date column?

 

Thanks!

1 ACCEPTED SOLUTION
v-deddai1-msft
Community Support
Community Support

Hi @Analytics4Life1 ,

 

Would you please try the following calculated column:

 

Date = FORMAT(DATE('Table'[YERR],'Table'[Month],1),"MM-YYYY") 

 

Capture3.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

View solution in original post

3 REPLIES 3
v-deddai1-msft
Community Support
Community Support

Hi @Analytics4Life1 ,

 

Would you please try the following calculated column:

 

Date = FORMAT(DATE('Table'[YERR],'Table'[Month],1),"MM-YYYY") 

 

Capture3.PNG

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regards,

Dedmon Dai

Thanks for the above information.

But how can I combine Date, Month, Year at the same time?

 

I am getting error while doing.

 

Please help!

amitchandak
Super User
Super User

@Analytics4Life1 , You need year and month for this . Assume both are in number format

 

format(Date([year],[month],1),"MM-YYYY") //where year and month are columns

 

format([Date],"MM-YYYY") //Date is a column

 

format(today(),"MM-YYYY")



Features || Datamarts: https://youtu.be/8tskWsJTEpg || Field Parameters : https://youtu.be/lqF3Wa1FllE?t=70
Time Intelligence Decoded : https://youtu.be/aU2aKbnHuWs&t=145s || Learn 50+ Power Query List Functions
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Dashboard of My Blogs !! Connect on Linkedin !! Subscribe to my youtube Channel !!!! How to get Quick Help !!
Resources | Master Power BI !! Expertise Power BI !! Power BI For Tableau User !!

Helpful resources

Announcements
collabdays lisbon

CollabDays Lisbon - 26 November 2022

Sessions include practical, hands-on experience that will help you take the next step in your career and know-how.

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.