CONTAINS with ANY(SELECT expression

Hi,

I have an enumlist that is made up from another enumlist. Because of this the Valid IF formula is this below with SPLIT

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), " , ")

This works fine except if the first numlist has only one value as there are no “,” in the cell to SPLIT. I get a “This entry is invalid” message.

I want to put an IF function in that asks if the cell CONTAINS “,” if it does then use the first expression above otherwise just EQUAL the single value.

I have added LIST to the last part to give the right typr of result even though there is only one value in the list. It does however give the correct result when I hit “TEST” in the expression assistant!

It’s not working though and won’t even let me toggle to the view with the enumlist in now though.

IF(CONTAINS(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), " , "),

SPLIT(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL())), " , "),

LIST(ANY(SELECT(Users[Counties Allowed], [User Id]=USEREMAIL()))))

thanks

Phil

0 3 823
3 REPLIES 3
Top Labels in this Space