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.
Hi All,
I have two tables.
Table 1:
Full Postal Code |
RG42 9PY |
SL1 4WE |
GL4 3DL |
SL7 1HY |
B37 7HQ |
RH1 1SH |
EC1A 7AJ |
Table 2:
postcode | region |
AB55 | Moray |
AB56 | Moray |
B1 | Birmingham |
B10 | Birmingham |
B11 | Birmingham |
B12 | Birmingham |
B13 | Birmingham |
B14 | Birmingham |
B15 | Birmingham |
B16 | Birmingham |
B17 | Birmingham |
B18 | Birmingham |
B19 | Birmingham |
B2 | Birmingham |
I want to Search post code value from table to Table 1 full and code and wanted a new column in the table 1 which gives me Region of table 2
Solved! Go to Solution.
I want to Search post code value from table 2 to Table 1 full post code and wanted a new column in the table 1 which gives me Region of table 2
Hi @cyborgandy ,
According to your description, I create a sample containing the corresponding value.
Table1:
Table2:
Here's my solution, use the containsstring-function to create a calculated column in Table1.
Column =
MAXX (
FILTER (
'Table 2',
CONTAINSSTRING ( 'Table 1'[Full Postal Code], 'Table 2'[postcode] )
),
'Table 2'[region]
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @cyborgandy ,
According to your description, I create a sample containing the corresponding value.
Table1:
Table2:
Here's my solution, use the containsstring-function to create a calculated column in Table1.
Column =
MAXX (
FILTER (
'Table 2',
CONTAINSSTRING ( 'Table 1'[Full Postal Code], 'Table 2'[postcode] )
),
'Table 2'[region]
)
Get the correct result.
I attach my sample below for reference.
Best Regards,
Community Support Team _ kalyj
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I want to Search post code value from table 2 to Table 1 full post code and wanted a new column in the table 1 which gives me Region of table 2
Hi:
You can compare the strings but need to know how many letters to match. Here is example of using first three letters .
Calc Col=
var tableonefirst3 = LEFT('Table 1'[FullPostalCode], 3)
var Tabletwofirst3 = LEFT('Table 2'[postcode],3)
return
IF(tableonefirst3 = Tabletwofirst3, 'Table 2'[Region], BLANK())
This is't perfect if you have very similiar entries on both sides.
I hope this helps!
Hi:
There does not appear to be anything to relate form one table to another. (Based on your example).
In table2 you have:
AB55 | Moray |
AB56 | Moray |
and a number of B/Birmingham - I don't see a reference(in part) on Table1?
What is the expected result? Maybe reposting data where there is something in common will help.
Hey basically I have two table one where I have full post code and the 2nd table I have partial post code details with the region I want the region of table to be assigened to table 1
e.g If AB55 found in table 1 in full post cost row it should give me a region from table 2 of AB55
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 |
---|---|
26 | |
10 | |
10 | |
9 | |
6 |