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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
ahsanlhcgov
Helper III
Helper III

changing numbers of the months to names

I am very new to Power BI and this may seem a very basic question.

 

I have a FiscalMonth feild added to my dashboard but for some reason its showing the numbers of the months rather then the names, 

 

Is it possible to change the numbers to names?

 

Thank you

 

 

2 ACCEPTED SOLUTIONS

Hi @ahsanlhcgov,

Do you want to display month names in the slicer and visual as shown in the following screenshot?  
1.PNG


If that is the case, please click the Month column in the Field Pane, then select FiscalMonth after clicking “Sort By Column” under Modeling ribbon, there is an example for your reference. This way, you are able to achieve your requirement.
2.PNG


Thanks,
Lydia Zhang

Community Support Team _ Lydia Zhang
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

that is perfect. thank you very much.

View solution in original post

17 REPLIES 17
vickyprudhvi
Helper IV
Helper IV

Yes it is possible. u need to create calculated column for it

and use below measure

=format([Date],"MMM")

 

I am using a direct query which is not allowing me to use it. 

 

my query is 

 

FiscalMonth = if (month(vMyLHCStats[dtadded]) <4, month(vMyLHCStats[dtadded])+9 , (month(vMyLHCStats[dtadded])-3)) 

Function 'FORMAT' is not allowed as part of calculated column DAX expressions on DirectQuery models.

are u using tabular model?

I am quering SQL so i beleive it is a tabular model. 

u mean u are connecting sql server db directly to Pbix using Directquery mode?

yes. 

According to my knowledge i guess u wont be able to write any measure on direct query mode. So rather create a view and in that view you would be able to get names for Months

i have another view for months which does the same thing exactly but the problem why I cant use it is because the view is sorted alphabatically and I dont know how to change it according to the months in a year. If thats possible please let me know

You can use "Sort by" feature to sort the text month column with the numeric month column.

while importing data from a SQl Server database in Direct Query modde. there is an advanced options

where u can write sql query. can u try

select * from view order by MonthNum

Only other way that i know of is to use the sorting option in the visual. have u tried that ?

it only gives option to sort it in ascending and descending order. no good for me. 

 

 

how do u want to sort then?

ur initial question was to convert month number to Month name,right?

is this another question?

i want to sort them from APRIL to MARCH.  I ve got 2 views one is FiscalMonth and the other one is just Month. 

 

when using the FiscalMonth the slicer on PB shows the months in numbers starting from 1-12 which is correct but due to direct query I cant change the names i.e I cant change 1 to JAN , 2 to FEB and so ON.

 

when using Month the slicer on PB shows the month names alphabatically i.e  APRIL, AUGUST, JULY, JUNEalphabatical.PNGfiscalmonth.PNG

I hope this will give u a better idea. 

Hi @ahsanlhcgov,

Do you want to display month names in the slicer and visual as shown in the following screenshot?  
1.PNG


If that is the case, please click the Month column in the Field Pane, then select FiscalMonth after clicking “Sort By Column” under Modeling ribbon, there is an example for your reference. This way, you are able to achieve your requirement.
2.PNG


Thanks,
Lydia Zhang

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

that is perfect. thank you very much.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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