Forum Discussion
MatM
4 years agoMicrosoft Employee
Filtering based on prefix match
I have two tables. Table1 -- main data Path Interesting data Interesting data /uk/london/central/bank ... /uk/london/central/mayfair /uk/london/central/mayfair /...
- 4 years ago
Hi MatM,
You could use the 'fuzzy merge' option to match on Path. You may need a little trial and error to get the settings just right, but in your sample data, it worked with the defaults.
let Source = Table.FromRows( Json.Document( Binary.Decompress( Binary.FromText( "i45W0i/N1s/Jz0vJz9NPTs0rKUrM0U9KzMtW0lHS09MDkgpKsTpYVeUmVqYlZhaBlZCvrDy1uARDLjkxN6koMyU9FSETCwA=", BinaryEncoding.Base64 ), Compression.Deflate ) ), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Path = _t, #"Interesting data" = _t, #"Interesting data.1" = _t] ), #"Changed Type" = Table.TransformColumnTypes( Source, {{"Path", type text}, {"Interesting data", type text}, {"Interesting data.1", type text}} ), #"Merged Queries" = Table.FuzzyNestedJoin( #"Changed Type", {"Path"}, TableB, {"Path"}, "TableB", JoinKind.LeftOuter, [IgnoreCase = true, IgnoreSpace = true] ), #"Expanded TableB" = Table.ExpandTableColumn(#"Merged Queries", "TableB", {"Scope"}, {"Scope"}) in #"Expanded TableB"PBIX example attached for reference.
Hope this helps.
v-yalanwu-msft
4 years agoCommunity Support
Hi, MatM ;
You could use custom visual -text filter .
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA104381309?tab=Overview
https://appsource.microsoft.com/en-us/product/power-bi-visuals/WA200001464?tab=Overview
Best Regards,
Community Support Team_ Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.