Forum Discussion
Anonymous
3 years agoNot applicable
Circular dependency
I have a month column. No date only month. I then created a Month Number. Month Number = SWITCH('Account Changes 2016-2022'[Month], "January",1, "February",2, "March",3, "April",4, "May",5, ...
- 3 years ago
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.)
ppm1
3 years agoSolution 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