Getting Specific Values From Another Column

I have a column that I only want specific values from.

Comp-ID
1-5555
1-88888
1-9999
1-5577
1-6363
1-45455

I only want the following values:
1-5577
1-6363
1-45455

Can anyone help with DAX or a Calculated Column?

Hi @michael.gyure,

There are many ways to achieve this. First, you’d want to push a transformation like this as far back to the source as possible. Knowing nothing about your data source, I’ll limit my suggestions to Power Query and DAX.

1 Power Query, Custom Column:

Table.AddColumn(Source, "Custom", each List.First( List.Intersect( {{"1-5577", "1-6363", "1-45455"}, {[#"Comp-ID"]}}) ))

2 DAX, Calculated Column:

CC = INTERSECT( {"1-5577", "1-6363", "1-45455"}, {'Table'[Comp-ID]} )

I hope this is helpful

1 Like

@Melissa ,

Thank you, it worked great!