Forum Discussion
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.
- Anonymous2 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 XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- AnonymousNot applicable
Hi E5254730
If I understand you correctly, you have two tables, one with last week's data and the other with this week's data? And then you want to display them in the same table? Could you please provide some data so that I can help you better?
How to provide sample data in the Power BI Forum - Microsoft Fabric Community Or show them as screenshots. Please remove any sensitive data in advance.
Best Regards,
Yulia Xu- E5254730Helper 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:
- AnonymousNot 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 XuIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- E5254730Helper II
Prior Week Table:
ID Achieved Date Sales (USD) Category 88316 11-Jan-2022 $ 37,702.00 A 64396 21-Jan-2022 $ 22,896.00 A 86660 04-Feb-2022 $ 22,202.00 B 51718 22-Feb-2022 $ 19,195.00 B 54344 25-Feb-2022 $ 28,376.00 C 67291 04-Mar-2022 $ 42,044.00 C 64191 14-Mar-2022 $ 45,887.00 D 85236 10-Mar-2022 $ 10,272.00 E 85229 05-Apr-2022 $ 44,270.00 E Current week table:
ID Achieved Date Sales (USD) Category 88316 11-Jan-2022 $ 47,993.00 A 64396 21-Jan-2022 $ 34,688.00 A 86660 04-Feb-2022 $ 42,617.00 B 51718 22-Feb-2022 $ 15,649.00 B 54344 25-Feb-2022 $ 10,971.00 C 67291 04-Mar-2022 $ 8,434.00 D 64191 14-Mar-2022 $ 6,933.00 D 85236 10-Mar-2022 $ 3,709.00 E 85229 05-Apr-2022 $ 7,661.00 E 59716 29-Mar-2022 $ 8,079.00 E Below is the output from both the tables. I also created unique no's from ID column, yet no luck