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
Hi everyone,
I have a challenge that I will need your help to resolve.
I have 2 data tables : Table1 contains 10 columns and one of the columns contains Postal Code (full), the second Table2 contains 2 columns (Postal Codes and CityName). However the Postal code contains only some elements of the full Postal Code in the Table1.
For example, Table1 contains PO5 1LH but Table2 contains PO5 or 1LH.
My challenge is to lookup the Post Code in Table 2 and compare with Table1, if there is any match of the first 3 elements or the last 3 elements, the code will return the Name of the City in Table 1.
Please help 🙏.
Thank you
Solved! Go to Solution.
Try this calculated column in Table2:
City =
MAXX (
FILTER ( Table1, CONTAINSSTRING ( Table1[Postal Code], Table2[Postal Code] ) ),
Table1[City]
)
Proud to be a Super User!
Try this calculated column in Table2:
City =
MAXX (
FILTER ( Table1, CONTAINSSTRING ( Table1[Postal Code], Table2[Postal Code] ) ),
Table1[City]
)
Proud to be a Super User!
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 41 | |
| 38 | |
| 36 | |
| 30 | |
| 28 |
| User | Count |
|---|---|
| 128 | |
| 88 | |
| 79 | |
| 67 | |
| 62 |