Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
asrarkhan26
Regular Visitor

Compare two table column value and keep duplicate also

I have two table of same column but in week -2 has updated vendor. I need to bring vendor of week-1 into week-2 table for same Name column in Week-2. However Name column can have duplicate value for both week table and vendor may or may not be same. I need to compare both vendor vcolumn of two different week and if matched then mention result as Matched otherwise not matched. Do we get this kind of solution in Power BI?


Week - 2
Name                 Vendor

Notebook           Apple
Notebook           Samsung
Phone                 Lenovo
Phone                 Motorola
Phone
Battery
Charger               Samsung
Adapter               Sony
TV                        LG

 

Week - 1
Name                Vendor
Notebook         Samsung
Notebook         Sony
Phone
Phone               Motorola
Phone               Lenovo
Battery
Charger            Samsung
Adapter            Sony

 

                             Week-1                      Week-2                                                 Whether Week-1 and Week 2 Vendor Matched
Name                    Vendor                     Vendor                                                    Result
Notebook             Apple                        Sony                                                       Not Matched
Notebook             Samsung                  Samsung                                                 Matched
Phone                   Lenovo                     Lenovo                                                    Matched
Phone                   Motorola                  Motorola                                                 Matched
Phone                                                                                                                    Matched
Battery                                                                                                                   Matched
Charger                 Samsung                 Samsung                                                  Matched
Adapter                 Sony                        Sony                                                         Matched
TV                          LG                                                                                            Not Matched

2 REPLIES 2
Sahir_Maharaj
Super User
Super User

Hello @asrarkhan26,

 

1. Create a new table that combines the data from both tables using the "Append Queries" function in Power Query. In the Power Query Editor, go to the "Home" tab and select "Append Queries". Select the Week 1 and Week 2 tables, and then click "OK". This will create a new table that combines the data from both tables.

 

2. Create a calculated column in the new table that compares the vendors for each Name.

Vendor Matched = 
IF(ISBLANK([Vendor Week 2]), "Not Matched", 
   IF([Vendor Week 1] = [Vendor Week 2], "Matched", "Not Matched"))

 

3. Create a table or matrix visual that displays the Name, Vendor Week 1, Vendor Week 2, and Vendor Matched columns

 

This should give you a table that shows whether the vendors for each Name are matched or not, based on the data from Week 1 and Week 2.

 

Let me know if you have any other questions.


Did I answer your question? Mark my post as a solution, this will help others!

If my response(s) assisted you in any way, don't forget to drop me a "Kudos" 🙂

Kind Regards,
Sahir Maharaj
Data Scientist | Data Engineer | Data Analyst | AI Engineer
P.S. Want me to build your Power BI solution? (Yes, its FREE!)
➤ Lets connect on LinkedIn: Join my network of 15K+ professionals
➤ Join my free newsletter: Data Driven: From 0 to 100
➤ Website: https://sahirmaharaj.com
➤ Email: sahir@sahirmaharaj.com
➤ Want me to build your Power BI solution? Lets chat about how I can assist!
➤ Join my Medium community of 30K readers! Sharing my knowledge about data science and artificial intelligence
➤ Explore my latest project (350K+ views): Wordlit.net
➤ 100+ FREE Power BI Themes: Download Now
LinkedIn Top Voice in Artificial Intelligence, Data Science and Machine Learning

Kudos Sahir. It worked. Thank You 

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.