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!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
Hello All, I need your help in comparing two columns having delimiter seperated values, with transformation required based on 2nd table. I need to compare Column 1 and Column 2, both columns have delimiter seperated text values and also transform column 2 based on Table 2 (for comparison).
The sequence/placement of values doesnt matter - e.g. Red is in first place in row 1 but equivalent value in Column 2 (C1) is in second place.
Table 1
| Sr | Column1 | Column2 | Column3 (Result) |
| 1 | Red; Blue; Pink | C2; C1; C3 | Match |
| 2 | Yellow; Pink | C4 | Mismatch |
| 3 | Blue; Red | C1;C2 | Match |
Table 2
| Column1 | Column2 |
| Red | C1 |
| Blue | C2 |
| Pink | C3 |
| Yellow | C4 |
Solved! Go to Solution.
Are you trying to do this in the query editor (using M) or in your model (using DAX)?
It's not super pretty, but you can do this with a custom column in the query editor. The code for that step would look something like this (assuming Column1 and Column2 have had spaces removed):
= Table.AddColumn(#"Previous Step", "Column3", (r) => if Table.SelectRows(Table2, each List.Contains(Text.Split(r[Column1], ";"), [Column1]))[Column2] = List.Sort(Text.Split(r[Column2], ";")) then "Match" else "Mismatch", type text)
This code checks if two lists are equal. The first list is Table2[Column2] where Table2 has been filtered to only include values from that specific row in Table1[Column1]. The second list is Table1[Column2] value in that row turned into a list by splitting on ";" and sorting alphabetically (to match the order in Table2).
Are you trying to do this in the query editor (using M) or in your model (using DAX)?
It's not super pretty, but you can do this with a custom column in the query editor. The code for that step would look something like this (assuming Column1 and Column2 have had spaces removed):
= Table.AddColumn(#"Previous Step", "Column3", (r) => if Table.SelectRows(Table2, each List.Contains(Text.Split(r[Column1], ";"), [Column1]))[Column2] = List.Sort(Text.Split(r[Column2], ";")) then "Match" else "Mismatch", type text)
This code checks if two lists are equal. The first list is Table2[Column2] where Table2 has been filtered to only include values from that specific row in Table1[Column1]. The second list is Table1[Column2] value in that row turned into a list by splitting on ";" and sorting alphabetically (to match the order in Table2).
Thank you, the solution worked perfectly.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 11 | |
| 11 | |
| 6 | |
| 6 | |
| 6 |