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
biofio
Frequent Visitor

Filtering on many to many relationship

My data setup is like this:

 

I have one table with ReviewId as the primary key, and another table that looks like this:

 

ReviewId     |      Platform

1                        xbox

1                        windows

2                        xbox

2                        mobile

3                        xbox

...                       ...

 

And so on. What I want to do is create a slicer on the platform feature, so if I select "xbox", it filters the reviews so I only have the reviews that have an "xbox" entry in the previous table.

 

The ReviewId's and Platforms are linked by another ID, "BigId". So one BigId generates multiple reviews and multiple platforms, which I believe is the reason that the normal slicers do not function as I want. Thanks for any help.

5 REPLIES 5
Anonymous
Not applicable

Can you screenshot your data model?

Here is what I am working with:

relationshipsrelationshipsreview platform relationshipreview platform relationshipmain reviews tablemain reviews table

HI @biofio,

 

I'd like to suggest you create a calculated table with merged union platform types, then use this table to link detail tables which you used.

Platform Bridge =
DISTINCT (
    UNION (
        VALUES ( platformInfo[TargetedPlatforms] ),
        VALUES ( WorkOrder[TargetedPlatforms] )
    )
)


After these steps, you can use above bridge table to filter with all detail tables.

 

Regards,
Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

I think I am still confused. So if I have one many-to-many relationships (let's say Platforms:Reviews), and I construct a bridge table*, then how do I actually use that bridge table to filter? I want to be able to select one a subset of platforms and give me only those reviews that have a relationship with those platforms.

 

* My bridge table (Bridge) looks like (ignore BigId):

reviews.PNG

 

Linked to this, I have a one-column table:

 

Platforms

TargetedPlatform

xbox

mobile

windows

...

 

Reviews

ReviewId | Latency | ...

38           | 3.5         | ...

 

So, Reviews has a 1:M with Bridge, and Platforms also has a 1:M with Bridge. Then how do I create my slicer based on this? I had figured do it on the "TargetedPlatform" field of Platforms, but that did not work.

HI @biofio,

 

I think you have misunderstood my suggestion.
First, my formula is used to extract all platform informations to create a unique table with platforms type.

 

Platform Bridge =
DISTINCT (
    UNION (
        VALUES ( Table1[TargetedPlatforms] ),
        VALUES ( Table2[TargetedPlatforms] ),
        VALUES ( Table3[TargetedPlatforms] )
    )
)

 

After create platform information table, you can create relationships between above table and platform columns from other tables.(multiple many to one relationship)


For example:
Table1 TargetedPlatforms to 'Platform Bridge' Platform Bridge,
Table2 'TargetedPlatforms' to 'Platform Bridge' Platform Bridge
Table3 'TargetedPlatforms' to 'Platform Bridge' Platform Bridge...

 

Finally, you can use 'Targeted Platforms' column to create slicer (from bridge table) to filter with all tables.

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

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.