Forum Discussion

czaldumbide's avatar
czaldumbide
Icon for Helper II rankHelper II
6 years ago
Solved

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 IDUser ID
1A
2A
3B

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 IDAmount
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 IDAccount IDSum of Amount
A1$150
B3$40
D5$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 IDAccount IDSum of Amount
A1$150
A2$50
B3$40
D5$70
D6$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.

    .pbix 

     

    Best regards,
    Lionel Chen

    If 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's avatar
    v-lionel-msft
    Icon for Community Support rankCommunity Support

    Hi czaldumbide ,

     

    Like this? Maybe you can try again.

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • czaldumbide's avatar
      czaldumbide
      Icon for Helper II rankHelper 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's avatar
      czaldumbide
      Icon for Helper II rankHelper II

      v-lionel-msft ,

       

      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's avatar
        v-lionel-msft
        Icon for Community Support rankCommunity 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.

        .PBIX  

         

        Best regards,
        Lionel Chen

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

  • v-lionel-msft's avatar
    v-lionel-msft
    Icon for Community Support rankCommunity Support

    Hi czaldumbide ,

     

    Try to refer to the .pbix file.

    .pbix 

     

    Best regards,
    Lionel Chen

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.