Forum Discussion
Circular dependency
I then created a Month Number.
Month Number = SWITCH('Account Changes 2016-2022'[Month],
I want to arrange month name in chronological order.
Thank you
One way to solve this is to add the Month Number column in the query editor instead of DAX.
You can do this with a custom column like this:
Date.Month(Date.From(([Month] & " 2000")))(Appending the " 2000" allows it to interpret e.g. "January 2000" as a date and then compute the month number for that date.)
2 Replies
- AlexisOlsonSuper User
One way to solve this is to add the Month Number column in the query editor instead of DAX.
You can do this with a custom column like this:
Date.Month(Date.From(([Month] & " 2000")))(Appending the " 2000" allows it to interpret e.g. "January 2000" as a date and then compute the month number for that date.)
- ppm1Solution Sage
The suggestion to do it in the query editor is a good one. Otherwise, you have two DAX options:
1. If you have another Date column in that table, use that to generate the Month Number column.
2. First create a duplicate column with Month2 = 'Account Changes 2016-2022'[Month]. Then point your switch column to the new Month2 column.
Pat