1
votes

I am trying to create a new Table using DAX. This new table will have rows filtered from an existing table called Table_A. Table_A needs to be filtered based on a column called PROD_ID from a related table called Table_B. PROD_ID column needs to be filtered based on multiple values of Product ids.

This is what I am doing-

Subtable_X =
CALCULATETABLE ( TABLE_A, RELATED ( TABLE_B[PROD_ID] ) = OR ( 123, 456, 678, ... ) )

The code is obviously not correct. Can anyone help me with a solution to get me the desired result?

1
Can you give some minimal example tables for input and desired output?Alexis Olson

1 Answers

0
votes

Look for DAX OR operator or IN operator:

https://www.sqlbi.com/articles/the-in-operator-in-dax/

This will work:

Subtable_X =
CALCULATETABLE ( TABLE_A, RELATED ( TABLE_B[PROD_ID] ) = { 123, 456, 678 } )

Alternatively use || (double pipes):