Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
i have table1 with column title column another table2 with column pattern and category
table1.title
"job xx run on"
"password for id xxx expired"
table2
pattern category
job*run Jobrun
password*expired passwordexpiry
with this now i want to get category in table1 with values table1.title matching table2.pattern , get table2.category
I did this in excel with just xlookup and match.
But how to do that in Powerquery power bi
Solved! Go to Solution.
Add Custom Column to Match Patterns
In Table1, add a custom column that looks through each Pattern in Table2, checks if it matches using a basic wildcard logic (we'll treat * as "any characters"), and returns the corresponding Category.
Go to Add Column > Custom Column in Table1 and paste:
let
currentTitle = [Title],
matchedCategory =
List.First(
List.Transform(
Table.SelectRows(Table2, each
Text.Contains(currentTitle, Text.BeforeDelimiter([Pattern], "*"))
and Text.Contains(currentTitle, Text.AfterDelimiter([Pattern], "*"))
)[Category],
each _
),
null
)
in
matchedCategory
This assumes your Pattern always has a single * (wildcard) in the middle.
What this does:
Example Result
|
Title |
Category |
|
job xx run on |
Jobrun |
|
password for id xxx expired |
passwordexpiry |
it worked . but with multiple wildcard in pattern . it will be difficult as number of wildcard is not predictable
Lightening speed answer . thanks
Add Custom Column to Match Patterns
In Table1, add a custom column that looks through each Pattern in Table2, checks if it matches using a basic wildcard logic (we'll treat * as "any characters"), and returns the corresponding Category.
Go to Add Column > Custom Column in Table1 and paste:
let
currentTitle = [Title],
matchedCategory =
List.First(
List.Transform(
Table.SelectRows(Table2, each
Text.Contains(currentTitle, Text.BeforeDelimiter([Pattern], "*"))
and Text.Contains(currentTitle, Text.AfterDelimiter([Pattern], "*"))
)[Category],
each _
),
null
)
in
matchedCategory
This assumes your Pattern always has a single * (wildcard) in the middle.
What this does:
Example Result
|
Title |
Category |
|
job xx run on |
Jobrun |
|
password for id xxx expired |
passwordexpiry |
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 22 | |
| 20 | |
| 14 | |
| 13 | |
| 13 |
| User | Count |
|---|---|
| 62 | |
| 40 | |
| 38 | |
| 38 | |
| 38 |