Forum Discussion
rlfRodrigo
2 years agoFrequent Visitor
Find whats different between elements of a string
Im having trouble figuring out how to get it done. Need to find the difference between elements of two strings using DAX A dummy table to ilustrate what i have: What i need on C: ...
- Anonymous2 years ago
Hi,
Thanks for the solution rajendraongole1 provided, and i want to offer some more information for user to rerfer to.
hello rlfRodrigo , you can refer to the following calculated column.
Column = VAR a = SELECTCOLUMNS ( ADDCOLUMNS ( GENERATESERIES ( 1, PATHLENGTH ( [A] ), 1 ), "Value_A", PATHITEM ( [A], [Value] ) ), "ValueA", [Value_A] ) VAR b = SELECTCOLUMNS ( ADDCOLUMNS ( GENERATESERIES ( 1, PATHLENGTH ( [B] ), 1 ), "Value_B", PATHITEM ( [B], [Value] ) ), "ValueB", [Value_B] ) RETURN CONCATENATEX ( EXCEPT ( a, b ), [ValueA], "|" )Output
Best Regards!
Yolo Zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Ashish_Mathur
2 years agoSuper User
Hi,
Just in case you are interested, this M code works
let
Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
#"Added Custom" = Table.AddColumn(Source, "Custom", each Text.Combine(List.Difference(Text.Split([Text1],"|"),Text.Split([Text2],"|")),"|"))
in
#"Added Custom"
Hope this helps.
rlfRodrigo
2 years agoFrequent Visitor
I thought about using M but both of my columns came from another calculated column so it wasnt possible without export/import
- Anonymous2 years agoNot applicable
Hi rlfRodrigo
You can refer to the solution I offered above. it gives the result you want.
Best Regards!
Yolo Zhu