Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have one column which is a list of items. I have a second column which is an exclusion list. I want to create a third column (or modify the first) to remove any item present in the second column. Please see example below. Thanks in advance for any help.
Column 1 | Column 2 | Result |
X,M,J,Z | Z | X,M,J |
B,C,V | B,C,V | |
C,D,F,G | F,G | C,D |
Solved! Go to Solution.
Using M/QueryEditor/Power Query...you can use this custom column
=Text.Combine( List.RemoveItems (Text.Split([Column 1],","),Text.Split([Column 2],",")) , ",")
As a DAX calculated column you can use.
Please see attached file with both ways
Calculated Column = VAR List1 = SUBSTITUTE ( [Column 1], ",", "|" ) VAR T1 = SELECTCOLUMNS ( ADDCOLUMNS ( GENERATESERIES ( 1, PATHLENGTH ( List1 ) ), "Item", PATHITEM ( List1, [Value], TEXT ) ), "Item", [Item] ) VAR List2 = SUBSTITUTE ( [Column 2], ",", "|" ) VAR T2 = SELECTCOLUMNS ( ADDCOLUMNS ( GENERATESERIES ( 1, PATHLENGTH ( List2 ) ), "Item", PATHITEM ( List2, [Value], TEXT ) ), "Item", [Item] ) RETURN CONCATENATEX ( EXCEPT ( T1, T2 ), [Item], "," )
As a DAX calculated column you can use.
Please see attached file with both ways
Calculated Column = VAR List1 = SUBSTITUTE ( [Column 1], ",", "|" ) VAR T1 = SELECTCOLUMNS ( ADDCOLUMNS ( GENERATESERIES ( 1, PATHLENGTH ( List1 ) ), "Item", PATHITEM ( List1, [Value], TEXT ) ), "Item", [Item] ) VAR List2 = SUBSTITUTE ( [Column 2], ",", "|" ) VAR T2 = SELECTCOLUMNS ( ADDCOLUMNS ( GENERATESERIES ( 1, PATHLENGTH ( List2 ) ), "Item", PATHITEM ( List2, [Value], TEXT ) ), "Item", [Item] ) RETURN CONCATENATEX ( EXCEPT ( T1, T2 ), [Item], "," )
Using M/QueryEditor/Power Query...you can use this custom column
=Text.Combine( List.RemoveItems (Text.Split([Column 1],","),Text.Split([Column 2],",")) , ",")
User | Count |
---|---|
123 | |
76 | |
63 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |