Forum Discussion
Anonymous
9 years agoNot applicable
Convert numbers to month
Hi everybody, I have a column with months dates in numbers. I want to convert it to text and keep the monthly order as Jun, Feb, Mar, Apr, etc.. I tried several trick like grouping or enterin...
- 9 years ago
Hi Anonymous,
The month column is RS month. I need to convert thos numbers in text as Jan, Feb, Mar, etc. but keeping the monthly order when showed in a graph.
In this scenario, you can use the formula below to create a new calculate column to convert the numbers in text as Jan, Feb, Mar, etc. :smileyhappy:
Short Month = SWITCH ( Table1[RS Month], 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 () )To keep the monthly order for the "Short Month" column, you can use the 'Sort by Column' option under Modeling tab.
- Select "Short Month" column.
- Click 'Sort by Column' option under Modeling tab.
- Select "RS Month" column.
Regards
vanessafvg
9 years agoCommunity Champion
matt mattson has this blog post
https://www.mattmasson.com/2014/02/creating-a-date-dimension-with-a-power-query-script/
use some of the logic here and do it in power query , you might have to convert then convert again.
and then in modelling in power bi set your name column to sort by the number.