Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
I have 2 Tables
TabSub
| sub |
| iron |
| thanos |
| spider |
TabFull
| full |
| ironman |
| superman |
| spiderman |
I want to lookup in full-string based on sub-string and get value in fron of sub-string in TabSub table
TabSub
| sub | full |
| iron | ironman |
| thanos | |
| spider | spiderman |
Solved! Go to Solution.
Hi @ddpl Please use below highlighted steps in TabSub table power query to findout full string based on sub string.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyizKz1OK1YlWKslIzMsvBjOLCzJTUouUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [sub = _t]),
TypeChanged = Table.TransformColumnTypes(Source,{{"sub", type text}}),
fullname = Table.AddColumn(
TypeChanged,
"FullName",
each
(
try
let
sub = [sub],
filterrows = Table.SelectRows(TabFull, each Text.Contains([full], sub))
in
filterrows{0}[full]
otherwise null
),
type text
)
in
fullname
Hope this helps!!
If this solved your problem, please mark it as a solution!!
Thanks for you reply, @shafiz_p .
Hi @ddpl , here's my solution you could try.
1.Add a custom column with table TabFull.
2.Expand it.
3.Add a custom column to compare them.
4.After filtering out false and below is the result.
If you wan to keep 'thanos', you can duplicate a table and merge them.
In the duplicated table, go to applied steps, remove the steps to the original.
Merge query and expand it:
Such a step-by-step operation, I hope it is convenient for you to understand.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @ddpl Please use below highlighted steps in TabSub table power query to findout full string based on sub string.
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WyizKz1OK1YlWKslIzMsvBjOLCzJTUouUYmMB", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [sub = _t]),
TypeChanged = Table.TransformColumnTypes(Source,{{"sub", type text}}),
fullname = Table.AddColumn(
TypeChanged,
"FullName",
each
(
try
let
sub = [sub],
filterrows = Table.SelectRows(TabFull, each Text.Contains([full], sub))
in
filterrows{0}[full]
otherwise null
),
type text
)
in
fullname
Hope this helps!!
If this solved your problem, please mark it as a solution!!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 6 | |
| 3 | |
| 3 | |
| 3 | |
| 2 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 5 |