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!Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi Team,
I have columns as below (excluding last column which the output Im trying to fetch) :
| Emp ID | Mgr ID | Employee States | Manager States | States Missing |
| G1 | G0 | A, B, C, D | A, B, D | C |
| G2 | G0 | X, Y, Z, E, F | Y, Z, F | X, E |
Im trying to add a new column at the end "States Missing" with the values that are not present in Manager states compared to Employee states. Im trying to do this powerquery.
Kindly help
Solved! Go to Solution.
you can try this to create a new column in PQ
= Table.AddColumn(#"Changed Type", "Custom", each
[a=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Remove([Employee States]," ")),
b=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Remove([Manager States]," ")),
c=List.Difference(a,b),
d=Text.Combine(c,",")
][d])
Proud to be a Super User!
you can try this
= Table.AddColumn(Source, "Custom", each
[a=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Trim([Employee States]," ")),
b=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Trim([Manager States]," ")),
c=List.Difference(a,b),
d=Text.Combine(c,",")
][d])
Proud to be a Super User!
you can try this to create a new column in PQ
= Table.AddColumn(#"Changed Type", "Custom", each
[a=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Remove([Employee States]," ")),
b=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Remove([Manager States]," ")),
c=List.Difference(a,b),
d=Text.Combine(c,",")
][d])
Proud to be a Super User!
@ryan_mayu , Thank you. It did work with the sample data I provided. Thanks for the same.
In my original data i have company names with space included like the below. May I know how can i modify this query to suit this.
| Employee States |
| Am ciat, Brian be, Ceat kod, Doug fen |
you can try this
= Table.AddColumn(Source, "Custom", each
[a=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Trim([Employee States]," ")),
b=Splitter.SplitTextByDelimiter(",", QuoteStyle.Csv)(Text.Trim([Manager States]," ")),
c=List.Difference(a,b),
d=Text.Combine(c,",")
][d])
Proud to be a Super User!
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 52 | |
| 50 | |
| 34 | |
| 15 | |
| 14 |
| User | Count |
|---|---|
| 94 | |
| 77 | |
| 41 | |
| 26 | |
| 25 |