Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi,
To simplify, there are 2 queries which contain 1 column only separately.
Is it possible I could do something like, " If Query1 contains Query2 then Query2"?
Will be fine if there are any ways to get the same result. Thanks!
Query1 |
ABC1, 123, 234A |
CDEF2-2, 15B |
DEF3-12, 128C |
EFGH4-543, 121D |
FGH5, 23151, 2185E |
GHI6, 21654, 18F |
HIJ7, -2132, 213G |
IJKLM8-8561, 0H |
JKL9-21, 451I |
KLMNOP0, 0, 11J |
Query2 |
ABC1 |
CDEF2 |
DEF3 |
EFGH4 |
FGH5 |
GHI6 |
HIJ7 |
IJKLM8 |
JKL9 |
KLMNOP0 |
Solved! Go to Solution.
You can also use the following without passing by an external custom function
Table.AddColumn(#"Changed Type", "OutputValue", (ValueToCompare) as text => Table.SelectRows(
Query2Tbl,
each Text.Contains(ValueToCompare[Col1], [Col1])
){0}[Col1])
Hope That is helpful
Hi @ngct1112
You can create a custom function to evaluate and return the desired value, like this
(ValueToCompare as text) as text => let
OutputValue = Table.SelectRows(Query2Tbl, each Text.Contains(ValueToCompare, [Col1]))
in
OutputValue{0}[Col1]
Then you call that function in a Table.AddColumn()
Let us know if that works for you
Regards
David
You can also use the following without passing by an external custom function
Table.AddColumn(#"Changed Type", "OutputValue", (ValueToCompare) as text => Table.SelectRows(
Query2Tbl,
each Text.Contains(ValueToCompare[Col1], [Col1])
){0}[Col1])
Hope That is helpful
@Geradav , I have read some acticle but still do not figure out how to add and apply the custom function. May I know do you have any resource I could learn from.
However, the second formula is really awesome and it works incredibly!!
Great thanks!
The Power Query documentation from Microsoft at https://docs.microsoft.com/en-us/powerquery-m/ is surely a good start.
Then you can read "M is for data Monkey" https://www.skillwave.training/shop/m-is-for-data-monkey/
Read more articles and subscribe to some newsletters here https://www.poweredsolutions.co/
Hi @ngct1112
You can use Merge Queries
https://www.youtube.com/watch?v=dTdFt9AvDHA
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
105 | |
78 | |
67 | |
63 |
User | Count |
---|---|
148 | |
107 | |
106 | |
83 | |
70 |