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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Manivannan
Helper I
Helper I

Month Name

Hi All,

 

I have created a direct query to display month. But it is displaying in numbers.

This is the query i used : "DATEPART("MONTH" , [AxDB].[dbo].[CUSTINVOICETRANS].[INVOICEDATE]) as Month,"

 

Capture.PNG

 

Actually i need it to be displayed in name, like JAN, FEB & MAR so on....

Kindly suggest a solution.

 

 

 

Regards,

Manivannan M

 

2 ACCEPTED SOLUTIONS

Then you can try adding a conditional column with if [MonthNo] = 1 then [MonthName] = "JAN" for every one month. 

View solution in original post

@Manivannan

 

In Direct Query mode, all direct format approach with DAX/POWER QUERY will not work. You can only use SWITCH() to get the Month Name as @ausrine suggested. 

 

6.PNG

 

Regards,

 

 

View solution in original post

6 REPLIES 6
ausrine
Frequent Visitor

Hi @Manivannan,

You can do it manually, using:

MonthName =
SWITCH (
    Table[MonthNo],
    1, "JAN",
    2, "FEB",
    3, "MAR",
    4, "APR",
    5, "MAY",
    6, "JUN",
    7, "JUL",
    8, "AUG",
    9, "SEP",
    10, "OCT",
    11, "NOV",
    12, "DEC",
    BLANK ()
)

Cheers,

Ausrine

Hi Ausrine,

 

I have used direct query for this.

How to use your solution in direct query?

 

 

Regards,

Manivannan M

 

@Manivannan

 

In Direct Query mode, all direct format approach with DAX/POWER QUERY will not work. You can only use SWITCH() to get the Month Name as @ausrine suggested. 

 

6.PNG

 

Regards,

 

 

Then you can try adding a conditional column with if [MonthNo] = 1 then [MonthName] = "JAN" for every one month. 

You should have written the full formula . Man Happy

PowerBee
New Member

Try FORMAT function with "mmm".

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.