How to get month name from month number in Power BI?

Serdia picture Serdia · Mar 23, 2017 · Viewed 57.7k times · Source

I have Year number and Month Number in my data. How using DAX can I get the month name out of month number?

In SSRS its very easy. But how to achieve that using DAX?

enter image description here

enter image description here

Answer

Foxan Ng picture Foxan Ng · Mar 23, 2017

You can use:

MonthName = FORMAT(DATE(1, [Num], 1), "MMM")

Result:

result

Nothing fancy, simply a reconstruction of a fake date from the month number provided, and reformat it with the FORMAT function.

Of course as an alternative you can go the old-fashioned way and write a SWITCH statement and hard-coded for the 12 months. It's up to you.