Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Filter multiple values in a column from filters selected

I have 2 tables. Table A is a dimension table having 2 columns, code and description. There are 8-10 codes in this table along with their descriptions.

CodeDescription
914940002Some text1
914940004Some text2

Table B is a fact table having multiple columns, one of which is code. Code column in Table B has rows with in the following format:

CodeDescription
914940002Some text1
914940002, 914940004Some text1, Some text2


and so on. I want to filter Table B by Table A such that when I click a Description from Table A (I will be using Table A as a filter slicer), it returns all the rows in Table B that contain that Description (in the above example, both rows will return as they both contain that description).

Please explain using Power Query or DAX how I can do this

1 ACCEPTED SOLUTION
Hazenm
Advocate II
Advocate II

@Anonymous - Can you modify Table B? Or does it have to remain in that format? 
If you can modify Table B, I would use power query to split the code column into rows. If you go into power query, and right click on the column table for code and click "Split Column" -> "By Delimiter" then select Comma. Then you can select advanced options, and split into new rows. 
This will split your table and give each code line a unique row. 
Then you can create a relationship between table A and table B on Code column, and your visualizations will filter as needed. 

View solution in original post

6 REPLIES 6
JamesFR06
Resolver IV
Resolver IV

@OsamaKamal 

Mesure 8 =
Var texte=selectedvalue(Table1[Description])
var textfinal=SELECTEDVALUE('Table2'[Code])
return
if(CONTAINSSTRINGEXACT(textfinal,texte),1)
 
And after you put this measure in your panel filter with value 1 and only rows with the selected text will be in
Anonymous
Not applicable

Table 1 and Table 2 are A and B respectively ? As per the tables I shared

 

Yep sorry. Table1 is Table A and T2 Tb

Anonymous
Not applicable

This doesn't work

Hazenm
Advocate II
Advocate II

@Anonymous - Can you modify Table B? Or does it have to remain in that format? 
If you can modify Table B, I would use power query to split the code column into rows. If you go into power query, and right click on the column table for code and click "Split Column" -> "By Delimiter" then select Comma. Then you can select advanced options, and split into new rows. 
This will split your table and give each code line a unique row. 
Then you can create a relationship between table A and table B on Code column, and your visualizations will filter as needed. 

Anonymous
Not applicable

This works. Thank you!

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.