Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello,
Im trying to do this calculation on power query,
I have two tables (Table 1 and Table 2), and I want to filter the information in Table 2 from Table 1 and I am looking for two things:
1. If the records exist within the Table 1 table, leave me those records, delete the other records that correspond to the same country (USA) and leave me all other records of the other countries.
2. If the records exist within Table 1, I remove those records and leave all other records of the same country (USA) and other records of the other countries.
I hope someone could help me, with this.
Table 1
Table 2
Thanks for the help!
Greetings
Mónica
Solved! Go to Solution.
2 is easiest:
Start with Table2 and merge it with JoinKind.LeftAnti with Table1. This will keep all rows from Table2 that are NOT contained in Table1.
for the first case I'd group both tables on Country and then do a LeftAnti Merge to keep just those countries who are not included in Table 1 and then a JoinKind.Inner to grab the countries where there is a match. Then a RightAnti on these results to keep only those who were included. Then append both tables.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
This seems like a problem for @ImkeF. Probably create a column that grabs your other table and this will appear as "Table" in this new column and then do something fancy with it.
2 is easiest:
Start with Table2 and merge it with JoinKind.LeftAnti with Table1. This will keep all rows from Table2 that are NOT contained in Table1.
for the first case I'd group both tables on Country and then do a LeftAnti Merge to keep just those countries who are not included in Table 1 and then a JoinKind.Inner to grab the countries where there is a match. Then a RightAnti on these results to keep only those who were included. Then append both tables.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
@ImkeF Thanks a lot for your help, Its works perfect!!
@Greg_Deckler Thanks to you too.
Greetings
Mónica
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
68 | |
68 | |
40 | |
29 | |
26 |
User | Count |
---|---|
88 | |
49 | |
45 | |
38 | |
37 |