Forum Discussion
naga449
5 years agoFrequent Visitor
Adding Serial Number using DAX(Not in Transform data)
Hi Community, Could you please help me with this, I have a Dim Table with countries, Country India Australia South America North America Japan Germany I want to sort...
Stachu
5 years agoCommunity Champion
you could use something like this:
Index =
SWITCH('Countries'[Country],
"India",0,
"Australia",1,
"South America",2,
"North America",3,
"Japan",4,
"Germany",5
)but althouth it will work, this is a bad practice. How is this table sourced, and what is the logic of the order? Or is it completely arbitrary?
- daxer-almighty5 years agoSolution Sage
You realize that this is totally unmaintainable unless... he has a list of all countries in the world?
- Stachu5 years agoCommunity Champion
Definitely, doing this in the Power Query/source should be the way to go, that's why I said it is a bad practice. But considering that some of the items are South America and North America I do not expect the list to be extremely long.