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?
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?
You can use:
MonthName = FORMAT(DATE(1, [Num], 1), "MMM")
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.
You can try this too:
Month name = FORMAT('Table'[date_column], "MMM")
If you use single quotes in 'MMM', it doesn't work. Ensure to use ""
u can use the Transform Value after you duplicate the Date Column and change the Day to Day Name.
If Format() function is not working you can the "SWITCH" function to map MonthNumber to MonthName.
MonthName = SWITCH(
TRUE(),
[MonthNumber] = 1, "January",
[MonthNumber] = 2, "February",
[MonthNumber] = 3, "March",
[MonthNumber] = 4, "April",
[MonthNumber] = 5, "May",
[MonthNumber] = 6, "June",
[MonthNumber] = 7, "July",
[MonthNumber] = 8, "August",
[MonthNumber] = 9, "September",
[MonthNumber] = 10, "October",
[MonthNumber] = 11, "November",
[MonthNumber] = 12, "December"
)
This formula checks the value of MonthNumber and returns the corresponding month name.
You can use FORMAT function to achieve this goal. = FORMAT('Tablename'[MonthNumber], "MMM") it will return the name of the month, e.g. July will be Jul, August will be Aug.
By Use of Switch DAX function MonthName = switch(True(), MonthID = 1, "jan",MonthID = 2, "Feb",MonthID = 3, "March",MonthID = 4, "April",MonthID = 5, "May",MonthID = 6, "June",MonthID = 7, "july",MonthID = 8, "Aug",MonthID = 9, "Sept",MonthID = 10, "Oct",MonthID = 11, "Nov",MonthID = 12, "Dec" )
© 2022 - 2025 — McMap. All rights reserved.
FORMAT
function. Does this work for you? – Skull