Sort values chosen from an EnumList, in the same order as enum list options order

Hi all,

I need some assistance please.

I have an enumlist (with ref base type) column. The listed values on the sheet to which it references, has a very specific order of listed values to choose. 

There is another column, that essentially is just an expression that references that enumlist column to return the key values of the list. However, these returned values are not sorted in the same hierarchy as the enumlist options, if that makes sense.

For example:

In the backend sheet, the list order might be like:

H, E, C, B

But then the column that references this list just to show the chosen key values, will then display it alphabetically no matter what.

Any ideas on how I can get the referenced values to show in the same order as the listed values? I hope this makes sense.

I will break it down below for further clarification:

Enumlist values, in order as shown in list:

K25.2, D5.6, A14.5

But then if a user selects the values A14.5 and K25.2, it will show chosen values (in the column that references it), ordered as A14.5, K25.2. It should be ordered as K25.2, A14.5.

Solved Solved
0 5 118
1 ACCEPTED SOLUTION

If I understood your case properly, lets assume that your rows in the source sheet are properly sorted. Then you can call them for your EnumList column like ORDERBY(SourceTable[KeyColumn],[_ROWNUMBER],FALSE). The EnumList then shows them in that same order with the label value. 

If you then need them in the same order but in a different column, then you could use an app formula like.. ORDERBY(SELECT(SourceTable[KeyColumn],IN([KeyColumn],[_THISROW].[EnumList])),[_ROWNUMBER],FALSE). Then it shouldn't matter in which order they are saved in the first place.

View solution in original post

5 REPLIES 5


@notmat111 wrote:

(in the column that references it),


You may want to share how the second column references the enumlist -meaning expression etc. Are these two columns in the same table? Some more details about the column details may help to suggest better.

Thanks for the response Suvrutt! @AleksiAlkio has provided the solution.

If I understood your case properly, lets assume that your rows in the source sheet are properly sorted. Then you can call them for your EnumList column like ORDERBY(SourceTable[KeyColumn],[_ROWNUMBER],FALSE). The EnumList then shows them in that same order with the label value. 

If you then need them in the same order but in a different column, then you could use an app formula like.. ORDERBY(SELECT(SourceTable[KeyColumn],IN([KeyColumn],[_THISROW].[EnumList])),[_ROWNUMBER],FALSE). Then it shouldn't matter in which order they are saved in the first place.

Thanks so much Aleksi.

For the original list sorting, I had your exact expression already. Your second expression was the solution for the other column. Amazing, can't thank you enough!

You're welcome!

Top Labels in this Space