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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Felipepbiplis
Frequent Visitor

Filter Dax rows with list

how to filter rows from a table type

1

2

3

4

 using a list column type

1,2,3,4

 in another table using dax functions?

 

ex: select value 1,3 in list and show 

 

1

 

in table rows

 

The tables do not have any data relationship and all data is text type.

1 ACCEPTED SOLUTION
puneetvijwani
Resolver IV
Resolver IV

@Felipepbiplis  As you mentioned there is no relation between table , A Nice way to solve this these using relationships with bridge table introduced between them and use that to get best out of the Power BI Modelling 

However Alternately  you can create measure to pass one selected value from one visual to other and use that to apply filters on the other in Filters pane or play bit with visual interactions

Here is DAX which can help you
1. Selected Value = SELECTEDVALUE(TAble1[Profiles],"No filter")
2. 
If filtered =

Var Filteredvalue =
If(CONTAINSSTRING([Selected Value],SELECTEDVALUE(Table2[Ruler]) ),1,0)
Return
Filteredvalue
 

Result will be something like below , Note that if i choose rick the IFfiltered measure becomes 1 for only those Rows in Table 2 , The you can use If filtered = 1 in your filter pane visual if you like 

But I believe changing your model can you give much better and clean results !
epunvij_0-1679327371206.png

-------------------------------------------------------------------------------------------------------------------------------

 

Good day, amigo! Have I provided the solution? If so, please let me know by adding the lovely, sweet "solution" tag to my post. And hey, if you're feeling very kind, give me a Kudos; after all, who doesn't enjoy a little digital gratitude?



View solution in original post

3 REPLIES 3
puneetvijwani
Resolver IV
Resolver IV

@Felipepbiplis  As you mentioned there is no relation between table , A Nice way to solve this these using relationships with bridge table introduced between them and use that to get best out of the Power BI Modelling 

However Alternately  you can create measure to pass one selected value from one visual to other and use that to apply filters on the other in Filters pane or play bit with visual interactions

Here is DAX which can help you
1. Selected Value = SELECTEDVALUE(TAble1[Profiles],"No filter")
2. 
If filtered =

Var Filteredvalue =
If(CONTAINSSTRING([Selected Value],SELECTEDVALUE(Table2[Ruler]) ),1,0)
Return
Filteredvalue
 

Result will be something like below , Note that if i choose rick the IFfiltered measure becomes 1 for only those Rows in Table 2 , The you can use If filtered = 1 in your filter pane visual if you like 

But I believe changing your model can you give much better and clean results !
epunvij_0-1679327371206.png

-------------------------------------------------------------------------------------------------------------------------------

 

Good day, amigo! Have I provided the solution? If so, please let me know by adding the lovely, sweet "solution" tag to my post. And hey, if you're feeling very kind, give me a Kudos; after all, who doesn't enjoy a little digital gratitude?



puneetvijwani
Resolver IV
Resolver IV

@Felipepbiplis  I tried to understand what you posted , Correct me if i am wrong


I am assuming you already expanded your original list in to rows 


if not then do expand it in Power Query  as below 

 

epunvij_1-1679248506610.png

 

 

Then use the simple Filter using DAX to create a new Table 

 

Filtered table = FILTER( 'Table containing List',
                         'Table containing List'[Original List] = "1"
                           || 'Table containing List'[Original List] = "3")
 

epunvij_0-1679248380829.png

Also replace "Table containing list" with the name of your original table , and replace column "Original List" with the name of that column.

Hope it Helps

Okay, I'll try to explain better.

There are two datatables in the power bi and
the tables have no relationship and all data is text type, tables below:
table1

NamesProfiles
AdrianABC
RickABC,XYZ
JhonABC,XYZ,UVZ
MikeABC,XYZ


table2

RulerValor1Valor2
ABC1a3c
XYZ2b3b
UVZ1a2d

 

I'm going to place the two tables in a common table visual on the dashboard.
When I click on a name in the table 1 visual, I want table2 to filter and show the filtered profiles rule corresponding to the name that was clicked.

example:

If I click on Rick in table1

table2 will look like this

RulerValor1Valor2
ABC1a3c
XYZ2b3b


thanks!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors