Forum Discussion

E5254730's avatar
E5254730
Helper II
2 years ago
Solved

How to create relationship between 2 tables having same columns in both tables

Hello,

Trying to attach excel for your reference, but do not see the option of upload

Below is the output I'm looking to achieve.

My both the tables has same columns. In Current week - line of data will be more than in Previous week.

Tried creating a Date table and creating a relationship with Achieved Date into my tables, but does not gives correct output.

 

Appreciate if someone can direct to achieve this. Thanks.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi E5254730 

     

    I would like to apologize for the belated reply.

     

    You can try the following:

     

    1. Create a calculated table as follows:

    Table = VALUES('Current week table'[Category])

     

     

    2. Create relationships as follow

     

     

    Output:

     

    You can also make changes to the column names. Double-click the corresponding column.

     

     

    Best Regards,
    Yulia Xu

     

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

5 Replies

    • E5254730's avatar
      E5254730
      Helper II

      I've added a small set of data in table format. But this is not properly showing in table format.

      Sending the screen shot as well:

      Prior Week:

       

      Current Week:

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi E5254730 

         

        I would like to apologize for the belated reply.

         

        You can try the following:

         

        1. Create a calculated table as follows:

        Table = VALUES('Current week table'[Category])

         

         

        2. Create relationships as follow

         

         

        Output:

         

        You can also make changes to the column names. Double-click the corresponding column.

         

         

        Best Regards,
        Yulia Xu

         

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

    • E5254730's avatar
      E5254730
      Helper II

      Prior Week Table:

       

      IDAchieved DateSales (USD)Category
      8831611-Jan-2022 $                37,702.00A
      6439621-Jan-2022 $                22,896.00A
      8666004-Feb-2022 $                22,202.00B
      5171822-Feb-2022 $                19,195.00B
      5434425-Feb-2022 $                28,376.00C
      6729104-Mar-2022 $                42,044.00C
      6419114-Mar-2022 $                45,887.00D
      8523610-Mar-2022 $                10,272.00E
      8522905-Apr-2022 $                44,270.00E

       

      Current week table:

       

      IDAchieved DateSales (USD)Category
      8831611-Jan-2022 $                                           47,993.00A
      6439621-Jan-2022 $                                           34,688.00A
      8666004-Feb-2022 $                                           42,617.00B
      5171822-Feb-2022 $                                           15,649.00B
      5434425-Feb-2022 $                                           10,971.00C
      6729104-Mar-2022 $                                             8,434.00D
      6419114-Mar-2022 $                                             6,933.00D
      8523610-Mar-2022 $                                             3,709.00E
      8522905-Apr-2022 $                                             7,661.00E
      5971629-Mar-2022 $                                             8,079.00E

       

      Below is the output from both the tables. I also created unique no's from ID column, yet no luck