Forum Discussion
Many to Many help
- 1 year ago
Hi naninamu ,
Use star schema always you can, so i recommend you to create a bridge table to avoid many-to-many relationships:
Create a Bridge TableGroupBridge = DISTINCT('Group Table'[GROUP])Connect Item Table[GROUP] to GroupBridge[GROUP] (one-to-many).
Connect Group Table[GROUP] to GroupBridge[GROUP] (one-to-many).Find ITEMS containing a specific THING by this DAX:
ItemsContainingThing = CALCULATE( DISTINCT('Item Table'[ITEM]), TREATAS(VALUES('Group Table'[THING]), 'Group Table'[THING]) )Find THINGS in a specific ITEM:
ThingsInItem = CALCULATE( DISTINCT('Group Table'[THING]), TREATAS(VALUES('Item Table'[ITEM]), 'Group Table'[GROUP]) )
Hello Bibiano_Geraldo - thanks for helping me out. I'm still getting an error, so thought I'd post my actual model to see if perhaps you could identify where I'm going wrong.
So in the above, each FileName (Item in my prev example) can be associated to different HashedSensitiveInfoTypes (Groups). Each HashedSensitiveInfoType has multiple SIT Names (Things).
Ultimately I'm trying to create a table listing the Filenames and all the SITs that belong to it.
I thought the issue might be with the Filenames as one file can have more than one HashedSensitiveInfoType - so I created an index and concatenated this with the Filename to give a unique value for each.
I could then drag in the HashedSensitiveInfoType value into my table that corresponded, but when I then tried to drag in SITNames to understand which SITNames fell under the HashedSensitiveInfoType, it gave me an error.
I can also have HashedSensitiveInfoType and SITName in a column without Filename and that works, but not all three.
Note when I use a many to many this works fine, but I know it's not best practice.
Any help much appreciated! Cheers, Andrew
Hi naninamu,
Can you please share a no sensitive information file pbix to see closer the problem? You have to upload to the cloud like onedrive or other and share the link for download here in comments.