Forum Discussion
SebaSpotti
Advocate II
2 years agoCreating an Index Column in a Calculate Table not in alphabetical order
Hi! I have this calculate table: - Dim_Seniority = DISTINCT(HC[HC Seniority Cluster]) that has those values: I want to create another column that index the values in tthe specific order ...
- Anonymous2 years ago
ryan_mayu Thanks for your contribution on this thread.
Hi SebaSpotti ,
You can update the formula of calculated table [Dim_Seniority] as below:
Dim_Seniority = ADDCOLUMNS ( DISTINCT ( HC[HC Seniority Cluster] ), "Index", SWITCH ( [HC Seniority Cluster], "< 1 year", 1, "1 year to 3 years", 2, "3 year to 5 years", 3, "5 year to 10 years", 4, ">= 10 years", 5, BLANK () ) )Best Regards
ryan_mayu
Super User
2 years agohave you tried to use SWITCH
Column = SWITCH('Table'[HC SeniorityCluster],"< 1 year",1,"1 year to 3 years",2,3)