Forum Discussion
Fixing table relationships
Hello Everyone,
The current relationships among my tables are not alloiwng me to derive a table visualization with my desired output. Let me walk you through my tables and what I've got so far so you can understand what I want to achieve.
I have 4 tables:
1) Accounts Table
| Account ID | User ID |
| 1 | A |
| 2 | A |
| 3 | B |
4 | C |
5 | D |
6 | D |
2) User Table
| User ID |
| A |
| B |
| C |
| D |
| E |
3) Risk Accounts Table
| Account ID |
| 1 |
| 3 |
| 5 |
4) Transactions Table
| Account ID | Amount |
| 1 | $50 |
| 1 | $100 |
| 2 | $50 |
| 3 | $40 |
| 5 | $70 |
| 6 | $10 |
The Accounts and User Table are related (many to 1) using User ID as the key. The Accounts and Risk Accounts table are related (1 to many) using Account ID as the key. And my Transactions and Accounts table are related (Many to 1) using Account ID as the key.
Using these relationships I get the following table visualization:
| User ID | Account ID | Sum of Amount |
| A | 1 | $150 |
| B | 3 | $40 |
| D | 5 | $70 |
But this is not what I want to see. Basically if a client appears in the Risk Accounts table, I would like to see the transactions made by all of the accounts of that client (even those that do no appear in the Risk Accounts table). So in the following table I also get transactions for Account ID 2 and 6 becuase they are related to User ID A and D. The table would look like this:
| User ID | Account ID | Sum of Amount |
| A | 1 | $150 |
| A | 2 | $50 |
| B | 3 | $40 |
| D | 5 | $70 |
| D | 6 | $10 |
Let me know if you understood what I'm trying to achieve. Any help would be appreciated.
Thanks
Hi czaldumbide ,
Try to refer to the .pbix file.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
6 Replies
- v-lionel-msft
Community Support
Hi czaldumbide ,
Like this? Maybe you can try again.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- czaldumbide
Helper II
Hi v-lionel-msft ,
Thanks for the suggestion. I currently do have that relationship between Accounts and Transactions Table, but I saw you did get the right end product. Could you please attach the pbix file so I can take a look at how you did it?
- czaldumbide
Helper II
In the snapshot you provided I don't see how you use Risk Accounts to filter the table. If you could provide a little more information on how you did it I would appreciate it.
Thanks!
- v-lionel-msft
Community Support
Hi czaldumbide ,
Sorry for the late reply. The reason why I don’t use the User table and the Risk Accounts table is because I think they are meaningless.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- v-lionel-msft
Community Support
Hi czaldumbide ,
Try to refer to the .pbix file.
Best regards,
Lionel ChenIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.