Forum Discussion
Data model help
- 6 years agoMan that data model is kind of a mess! 🙂
Only thing I see is that it is a many-to-many between the two tables in question. That could definitely cause some wonkiness. Perhaps try inserting a bridge table. - Anonymous6 years ago
Hi Greg_Deckler ,
Thank you for the suggestion! I had a good look into it and found an excellent blog post that explained what a bridge table is, relationships and cardinality!
https://www.seerinteractive.com/blog/join-many-many-power-bi/
I have now transformed my messy PBI auto assigned datamodel into something entirely functional with a bridge table (that I already had and didn't need to create!). The workings I'll share below to hopefully provide some clarity to anyone else who stumbles across this...
In the below photo, you can see the issue I had, an asbolute mess with lots of many to many reltionships filtering eachother. Datamodel before - auto assigned by PBI
My datamodel after, which works seamlessly! I've now have two bridge tables, one is a self created datetable using
DateTable 2019 = CALENDAR(DATE(2019,01,01),DATE(2019,12,31).
I have set the relationship from the date table to the Claims Reported, Claims Retained and Claims Outcome tables with a "Many to One" cardinality, with the cross filter diree=ction as single. This has prevented rows of data going missing as the date table contains a complete list of days in 2019.
I have also used the "Brokers" which was an existing tab in my data, placing this centrally using "Broker" to set the relationship to "Claims Retained", "Claims Reported" and "Claims Outcome". The reltionships of these has to be set to Many to Many, however I can set the Cross filter direction to "Single, (Brokers filters Claims X)". Setting this uses the Broker list as a reference point, preventing me from losing any data. Usin gthe combo of the "Broker" table and my "DateTable" allows me to compare everything against eachother. It also looks a lot cleaner as you can see below!
Data Model after - manually done
Kind regards,
Jordan
Hi, For some reason, every time I try to create a many-to many relation, I get this error message.
And when I link data through a bridge table, it doesn't link correctly in my report
Can you help me please?
- Anonymous5 years agoNot applicable
Hi imanhassan,
Can you raise this as a separate issue and @ me in it? If you could include a screenshot of the relationship view and a screenshot of the two tables you're trying to relate that would help me help you!
Kind regards,
Jordan
- imanhassan5 years agoFrequent Visitor
Anonymous , sorry but I have no access right to create a new issue. 😞
- Anonymous5 years agoNot applicable
imanhassan ah ok, well all the detail here you can. Send over that relationship view.
It's possible your bridge contains duplicates? Try removing all dups just to leave just unique values.