Forum Discussion
Convert numbers to Months
- 3 years ago
NewStep=Table.AddColumn(PreviousStepName,"Output wanted",each DateTime.ToText(Date.AddMonths(DateTime.LocalNow(),[Current Column]),"MMMM\'yy","en"))
Thanks! This is working. Suppose if I also want to add Year to it the output column, then how can this be done. Reason I now realise I want year is because both 0 and 12 yield the same output "February", however the latter should be February'24
NewStep=Table.AddColumn(PreviousStepName,"Output wanted",each DateTime.ToText(Date.AddMonths(DateTime.LocalNow(),[Current Column]),"MMMM\'yy","en"))
- SJHALANI3 years agoHelper I
Thank you! You are Awesome. I will mark this as a solution.
However, one last thing - When I build a chart using these Month-Year combination, the axis isn't sorted automatically based on the chrnology of months. Any quick way to do this?
TIA!- wdx223_Daniel3 years agoCommunity Champion
you need set "SortBy Column" in the table page, and select the [Current Column]