I have these two tables:
+-------------------+ +-------------------+
| TAB1 | | TAB2 |
+---------+---------+ +---------+---------+
| PRODUCT | ACCOUNT | | GR | MASK |
+---------+---------+ +---------+---------+
| apple | 1001 | | fruits | 1% |
| banana | 1002 | | cars | _2% |
| bike | 2101 | | bikes | 21% |
| car | 2202 | | other | 2[^12] |
| tree | 2401 | | spec | 2% |
| pool | 2502 | +---------+---------+
+---------+---------+
I need a resulting table which looks like this:
+-----------------------------+
| TABRES |
+---------+-------------------+
| GR | PRODUCT | ACCOUNT |
+---------+---------+---------+
| fruits | apple | 1001 |
| fruits | banana | 1002 |
| cars | car | 2202 |
| bikes | bike | 2101 |
| other | tree | 2401 |
| other | pool | 2502 |
| spec | bike | 2101 |
| spec | car | 2202 |
| spec | tree | 2401 |
| spec | pool | 2502 |
+---------+---------+---------+
The first table (TAB1) stores information about products and accounts related to those products.
The second table (TAB2) stores information about groups and related account masks.
I need to connect groups with the products.
There can be more than one group connected to a product ie. group "spec" will be related to products which belong to groups: cars, bikes, other.
I suppose that the key is to create an in-memory new table for each row in TAB2 as left join with filtering the TAB1 using a LIKE condition, where the value of parameter for LIKE is taken from a row of column MASK in table TAB2. At the end combined all results together and put it to one result table.
But I have no idea how to do it. I have tried it as a left join (blow) without any result.
I have tried in PowerQuery:
= Table.Join(tab2, {" MASK "}, tab1, {" ACCOUNT "}, JoinKind.LeftOuter)
But it doesn't work - this is what I get:
GR MASK PRODUCT ACCOUNT
fruits 1% null null
cars _2% null null
bikes 21% null null
other 2[^12] null null
spec 2% null null


Likeexpressions. Can you change the MASK or must the existing masks be translated into something understandable by M or DAX?