How do I make a slice filter with two values on a single cell to compare to another table?

Hello I have a table named JANUARY, which has a column "Cost Center" and other columns for values to show.
I also have a USER table, having "Email" and their assigned "Cost Center".

Now I have created a slice where a USER only sees rows having the same Cost Center on JANUARY table - got that working.

But I would Like to ask for help on how to filter my slice to show more than one Cost Center values on JANUARY table, when the assigned Cost Center on USER table is 2 or more.

USER Table:

Giane_Mosquera_0-1677558570409.png

 

JANUARY Table:

Giane_Mosquera_1-1677558594986.png

 

Now I want the filter to show rows for test@test.com that has the cost centers 1231 and 1211. Any help would be greatly appreciated.

Solved Solved
0 7 307
1 ACCEPTED SOLUTION

What is the type of the [Cost Center (old)]?

You should make it an ENUMLIST.

If it is of type TEXT then you could use SPLIT([Cost Center (Old)], ",") to make it into a list.  But SPLIT is not 'reliable' because the delimiter has to be precise and TEXT editing is usually very unreliable in terms of entering the right string, so I would usually stay away from it.

View solution in original post

7 REPLIES 7

Try using IN() in your filter expression.

okay I'll do that. 

Hello @TeeSee1 , how do I utilize the IN() along with the assigned email and cost center on my USER table? Also, the slice is from the January Table.

IN(
 [cost center],
 LOOKUP(
  useremail(),
  "USER TABLE",
  "Email",
  "Cost Center(Old)"
 )
)

Please adjust any of the names as required.

I added List() since In() looks for a list in its function. I got this working for only ONE assigned cost center ( example: 2111):

Giane_Mosquera_0-1677567990720.png

It's working for a single value. But when I assign two values (2111 , 2231), no items are shown on my slice ๐Ÿ˜ž I used the following formula too, but still has the same output with your answer @TeeSee1 .

IN([Cost Center], SELECT(User[Cost Center (Old)],[Email]=USEREMAIL()))

What is the type of the [Cost Center (old)]?

You should make it an ENUMLIST.

If it is of type TEXT then you could use SPLIT([Cost Center (Old)], ",") to make it into a list.  But SPLIT is not 'reliable' because the delimiter has to be precise and TEXT editing is usually very unreliable in terms of entering the right string, so I would usually stay away from it.

Wow. Yes I had to change the type of [Cost Center (old)] into ENUMLIST to make it work. Thank you so much!!

Top Labels in this Space