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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
OsamaKamal
Regular Visitor

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

@OsamaKamal - 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

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

This doesn't work

Hazenm
Advocate II
Advocate II

@OsamaKamal - 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. 

This works. Thank you!

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.