Reply
orihime0
Regular Visitor
Partially syndicated - Outbound

Modelling Many to Many Relationship and Counting Unique and Non-Unique Relationships

I have 2 fact tables that consist of unique values that are related to one another through an additional item-relationship:
Fact 1

orihime0_0-1725942197739.png

Fact 2

orihime0_1-1725942238034.png

 

Item Relation Table - As seen here, not every item in Fact 1 has a relationship to an item in Fact 2, and vice-versa

orihime0_6-1725942934009.png

Currently for visualization purposes, I have the following model. A visual table containing Items A needs to be able to filter another table with Items B down to the items related on selected Item A. (Ex. "1" is selected in one table, and the other table will filter down to A, B, and C)

orihime0_5-1725942574252.png

I have 2 questions regarding this model.

1) Obviously setting up the model like this is going to cause severe performance issues. Is there an alternate way to model this without having to combine Fact 1 and Fact 2 and grow the table exponentially?

2) I need to create DAX measures to indicate for every Item B, the count of times it is the only related item to Items A, and the count when it is not the only item related to Item A. Example below of what the table should look like. Also, preferably, when selecting an Item B, another table will filter down to the related Items A.

Item BUnique CountNon Unique Count
A12
B12
C01
D00

 

Any help is much appreciated!

1 ACCEPTED SOLUTION
mickey64
Super User
Super User

Syndicated - Outbound

For your reference.

 

"Model view"

mickey64_0-1725978068362.png

 

Selection "B" of "ItemB" on "Report view"

mickey64_1-1725978084523.png

 

Selection "2" of Item A on "Report view"

mickey64_3-1725978114532.png

 

 

View solution in original post

4 REPLIES 4
v-tangjie-msft
Community Support
Community Support

Syndicated - Outbound

Hi @orihime0 ,

 

Whether the advice given by mickey64  has solved your confusion, if the problem has been solved you can mark the reply for the standard answer to help the other members find it more quickly. If not, please point it out.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

mickey64
Super User
Super User

Syndicated - Outbound

For your reference.

 

"Model view"

mickey64_0-1725978068362.png

 

Selection "B" of "ItemB" on "Report view"

mickey64_1-1725978084523.png

 

Selection "2" of Item A on "Report view"

mickey64_3-1725978114532.png

 

 

danextian
Super User
Super User

Syndicated - Outbound

I'm curious why Item A has a completely different set of values from Item B. How do you know which Item A value is related to that from Item B?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

Did I answer your question? Mark my post as a solution!


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Syndicated - Outbound

As posted above, they are related to eachother through the Item Relation table:

orihime0_0-1725981758652.png

 

avatar user

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 2025 Power BI update to learn about new features.

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors (Last Month)
Top Kudoed Authors (Last Month)