Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Display related data when filtered in Power BI

Hello, here is my dataset :

enter image description here

What I would like to have is a filter on Campagne which shows all the other Campagne if the Contract number is the same. I explain myself. If I click on Campagne 3 in my filter, I want to see 1, 2, 3 and the attribution (the attribution by Campagne, not a Sum). Here is the expected result :

enter image description here

For now, the only solution that I have is to use a "temporary" table. But it's not optimal because I have to duplicate the data.

Any idea ?

Thanks a lot.

like image 479
Mathieu Ricour Avatar asked Oct 18 '25 15:10

Mathieu Ricour


1 Answers

You are going to have to create an extra table or two to get the slicer to work how you want. There's no way around it, but you only need to duplicate part of the data. Here's what I would suggest.


Create a new Slicer table by summarizing the Campagne and Contrat columns from your original table.

Slicer = SUMMARIZE(Table1, Table1[Campagne], Table1[Contrat])

Now since you want the filtering to be done by Contrat and this would require a many-to-many relationship with the original table, you need to create a bridge table.

Contracts = VALUES(Table1[Contrat])

Now set up the relationships on Contrat making sure that the Slicer to Contracts relationship has cross-filtering enabled both ways.

Relationship Diagram

Now you can use the Slicer[Campagne] column for your slicer and put Table1[Campagne] on your table and it should filter how you want.

Result

like image 74
Alexis Olson Avatar answered Oct 21 '25 01:10

Alexis Olson



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!