Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello all,
I have two tables:
one named Sites where I have:
| Item | Department | Province | District |
| 482964 | Loreto | Maynas | Tapiche |
| 741852 | Loreto | Ucayala | Contamana |
and another one called Geocode where I have:
| Ubigeo | Department | Province | District |
| 160509 | Loreto | Maynas | Tapiche |
| 160601 | Loreto | Ucayala | Contamana |
Goal:
I need to have the Ubigeo colum in the Sites table. The Ubigeo value from the Geocode table must be copied to the Sites table when the Department, Province and District values match between the tables.
| Item | Department | Province | District | Ubigeo |
| 482964 | Loreto | Maynas | Tapiche | 160509 |
| 741852 | Loreto | Ucayala | Contamana | 160601 |
Notes:
Can someone help me acchieving this result?
Thank you in advance!!!
Solved! Go to Solution.
The table name is missing in filter
maxx(filter(Geocode,Sites[Department] = Geocode[Department] && Sites[Province]=Geocode[Province] && Sites[District] = Geocode[District]), Geocode[Ubigeo])
Create a new column in the table1
new column = maxx(filter(table2,table1[Department] = table2[Department] && table1[Department]=table2[Department] && table1[Department] = table2[Department]), table2[Ubigeo])
Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution. In case it does not help, please provide additional information and mark me with @
Thanks. My Recent Blog -
Winner-Topper-on-Map-How-to-Color-States-on-a-Map-with-Winners , HR-Analytics-Active-Employee-Hire-and-Termination-trend
Power-BI-Working-with-Non-Standard-Time-Periods And Comparing-Data-Across-Date-Ranges
Connect on Linkedin
Hi @amitchandak thanks, but it is not working:
Custom column ->
maxx(filter(Sites[Department] = Geocode[Department] && Sites[Province]=Geocode[Province] && Sites[District] = Geocode[District]), Geocode[Ubigeo])
Error: Token Literal Expected below the highlited section above:
The table name is missing in filter
maxx(filter(Geocode,Sites[Department] = Geocode[Department] && Sites[Province]=Geocode[Province] && Sites[District] = Geocode[District]), Geocode[Ubigeo])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!