Grazi has attended:
Power BI Modelling, Visualisation and Publishing course
Power Automate Introduction course
Hierarchy and relationships
Hi there,
I have 3 tables which hold categories and sub-categories as a hierarchy – not my model, but it came straight from mySQL like this:
- Category – categorID is the unique ID
- Sub-category – with categoryID as the FK
- Sub-sub-category with Sub-category ID as the FK
Then I have the main table ‘cases’ which have the following fields / values from the tables above:
- CategoryID
- Sub-CategoryID
- Sub-sub-category ID
I created a relationship between the 3 tables, so I can do some hierarchy matrix / report visual, and then created the relationship between each of those tables and ‘cases’. This won’t work, and will keep a relationship as ‘inactive’.
What’s the way around this?
I'd attach the diagram mockup, but can't see an option to add files to his, let me know if this would be helpful and where I can send it to.
Thank you,
Grazi
RE: Hierarchy and relationships
Hi Grazi,
Thank you for the forum question.
I have replicated a model and connected Power BI. Please find attached Power BI file. The 3 category tables shouldn't be related to each other. Just relate the 3 tables to the main table.
Kind regards
Jens Bonde
Microsoft Office Specialist Trainer
Tel: 0207 987 3777
STL - https://www.stl-training.co.uk
98%+ recommend us
London's leader with UK wide delivery in Microsoft Office training and management training to global brands, FTSE 100, SME's and the public sector
Attached files...
RE: Hierarchy and relationships
Thank you Jens.
I can't see the Power BI file attached?
The problem I had by doing it by relating only the main table is that the counts didn't come correctly - since the counts are from the main table.
So the count from the main table doesn't know which sub or sub-sub categories it has since they're not related.
I'm keen to see your file to see if I'm doing something wrong.
Thank you so much, Grazi
RE: Hierarchy and relationships
Hi Jens, please ignore my last message. Once I logged in I managed to get the file and it works exactly as I need it to! :-)
I thought you meant linking the category tables instead of just the main one. It makes sense :-)
Thank you! Grazi