Forum Discussion
Help with relationships
- 4 years ago
Sounds like in your Weights database that the Part Group is not unique. Best way to tell: Add that column THREE times to a table visual. Leave the first one as it is, change the aggregation of the second to DISTINCT COUNT, and change the aggregation of the third to COUNT. Now look at the bottom numbers. If the COUNT = DISTINCT COUNT then the Part Group values are unique.
If you can get the Part Group values to be unique in the Weights database, then the relationship can be One-to-One, which makes sense for your mode.
Thank you very much! Do you mind if i ask how can i make the part groups unique? If the grouping database contains only Groupings and the list of Part groups, why can it form a relationship with the Base data, But the weight database, which has a list of part groups and weight cannot? I understand that i am most likely explaining this in a confusing way so i apologise.
In your Power Query, try aggregating the Weights Database by Part Group. Include aggregations like Average, Min, Max, and Row Count.
Think about it, you have identified a single Part Group in the Grouping database, and you want to know its Weight, so you traverse the relationship to the Weights database and see that there are TWO or more weights listed for that one Part Group. Which to choose? You have to get the Weights database down to ONE ROW per Part Group and an AGGREGATION in Power Query is an easy way to do it.
- Kieran-q_204 years agoHelper I
Thanks so much for all your help, the relationships are created as you described now, Just one more thing seems to be off. When i combine the grouping database and weights database to make a table, the table shows the same number weight for all Groupings, which i know is not correct, it seems to still be just counting entries. For example, when trying to display Groupings by weight, it reads the same number, which is odd. Once again thanks for all your help
- ToddChitt4 years agoSuper User
What do you mean by "combine the grouping database and weights database to make a table"?
Do you mean you are making a table visual on a report page, and adding the Grouping from the Group table and the Weight from the Weights table?
Do you have a one-to-one relationship set up between the two?
Can you show some sample data?
- Kieran-q_204 years agoHelper I
My apologies for the late response, my work shuts down for the weekend. Yes sorry i meant to say im making a table visual on a report page by adding the groupings from the grouping table and the weight from the weight table.
I do indeed have a 1 to 1 relationship between them and below is a snapshot of the relationships
I'm not sure if i can show much sample data, but i can show the difference in the actual returns table and the Weight table.
As you can see the weight table, which is on the right is identical across all rows, but the reutrns table works perfectly. The actual reutnrs table uses, Actual returns from the Base datatable, Groupings from the grouping database table and quarter from the base data table.
The weight table however uses, quarter from the base data table, groupings from the grouping database and Gross weight from the weight database.