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
Anonymous
Not applicable

Element / List relationship bewteen tables (element contained in list) | Filtering visuals

Hello,

 

I have a problem concerning filters and relationships bewteen tables in Power BI. I have two tables. The first one represents links between two entities (sort of like sellers), if they are linked IRL, there is a row in my first table, containing information about them, and in one of the column, there is a list of IDs (representing "how" they are linked) which identify the sales they made together. So you have for instance : 

 

ID_seller_1 | ID_seller_2 | .... |     list_of_IDs

18783783    18783124          [176,289,209,...]

 

The second table represents the sales, each row has the id of the sale (same as found in the list of IDs shown earlier), and informations about them. 

 

In Power-BI, I have two table visual, one with columns from the first table, and the other one with columns from the second table. What I want is that, whenever the user selects a row in the first table (the one with the links), the reports filters the data on the second visual, to show only the sales with the IDs inside the list of the column "list_of_IDs" inside said list. 

 

I can't figure out how to create this kind of filter nor how a list-element relationship between tables would work in power BI. Is there a tool to do it, has anyone out there done something similar in Power BI ? 

 

I would greatly appreciate your help, thank you in advance

 

Max Dedieu

1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

I created some data:

Table1:

Vpazhenmsft_4-1629876943394.png

 

Table2:

Vpazhenmsft_5-1629876953410.png

 

Here are the steps you can follow:

  1. Create measure.

Measure =

var _select=SELECTEDVALUE('Table1'[list_of_IDs])

return

IF(

_select=MAX('Table2'[list_of_IDs]),1,0)

 

  1. Place Measure in Filter, select is =1, apply.

Vpazhenmsft_6-1629876959994.png

3. Result:

Select a list_of_IDs of Table1, Table2 will only display the corresponding data:

 

Vpazhenmsft_7-1629876976546.png

Does this match your expected result ?

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
V-pazhen-msft
Community Support
Community Support

@Anonymous 

I created some data:

Table1:

Vpazhenmsft_4-1629876943394.png

 

Table2:

Vpazhenmsft_5-1629876953410.png

 

Here are the steps you can follow:

  1. Create measure.

Measure =

var _select=SELECTEDVALUE('Table1'[list_of_IDs])

return

IF(

_select=MAX('Table2'[list_of_IDs]),1,0)

 

  1. Place Measure in Filter, select is =1, apply.

Vpazhenmsft_6-1629876959994.png

3. Result:

Select a list_of_IDs of Table1, Table2 will only display the corresponding data:

 

Vpazhenmsft_7-1629876976546.png

Does this match your expected result ?

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Super User
Super User

@Anonymous I would recommend as a first step to split your list out in Power Query based upon the comma and then unpivot the columns.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Thanks for the response ! I think I see how it could solve the problem, however, as I see it, it wouldn't help me see "all" elements whose IDs are on the list I'm selecting. I would only make them appear one-by-one. Am I missing something here ? 

 

Thank you again for your help

 

Max

@Anonymous If you unpivot and then have a Both cross-filter relationship between your two tables based on sale id. You can create two visuals, one with your IDs from your sales table and then another with the seller id's from the table you showed. Click on the seller id in the second table visual and the first table visual will contain only the sale id's for that seller.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler Again, thanks for the response ! I think I see the whole idea, but i don't think it really works in my case, since I have two sellers. I feel like your solution fits the case where I just have a "sellers" table and a "sales" tables like the majority of people using PBI. I don't really see how I can make my problem work, maybe by creating a conditionnal table using DAX measure ? I really struggle with this issue haha

 

Thank you

 

Max Dedieu

@Anonymous I still am not sure what you are trying to accomplish. I feel like I have half of the information needed. 


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.