Forum Discussion

Mrafih's avatar
Mrafih
Frequent Visitor
3 years ago
Solved

Changing format from December to Dec on chart

Hello everyone,

 

I would like to change the formatting of the following graph

 

Instead of reading the full dates in the x axis I would like an abreviated version such as Jan, Feb ect.

 

Thanks!

 

  • Hi,

    Assuming the Months on the X-axis have been dragged from the Calendar Table, create this calculated column formula in the Calendar Table

    Month name short = format(calendar[date],"mmm")

    Ensure that this column is sorted by the Month number column.  To your visual, drag this new column.

    Hope this helps.

3 Replies

  • Hi,

    Assuming the Months on the X-axis have been dragged from the Calendar Table, create this calculated column formula in the Calendar Table

    Month name short = format(calendar[date],"mmm")

    Ensure that this column is sorted by the Month number column.  To your visual, drag this new column.

    Hope this helps.

  • Mrafih add another calculated column in your dimension with the following expression, and set the format to "mmm" by selecting this new column, and use it on the visuals.

     

    Month Short = EOMONTH ( 'Calendar'[Date], 0 )

     

  • Mrafih the solution Ashish_Mathur is one way to go but you can really avoid sort by column in this scenario. First thing, why you want to avoid that, here it is: when you are writing some advance DAX that needs to work with the month column, you can get unexpected results if you miss including sort by column in your measure, and this is a very common mistake and I have seen pull their hairs why a simple measure is not working.

     

    Maybe this is not relevant to your current visualization requirement but you always want to think through and avoid potential issues if a simple and scalable solution is available, in this case, adding an "End of Month" date column, changing the format to "mmm", you would have avoided sort by column. 

     

    Just my 2 cents.