Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
I found a function to replace text using a lookup table. It works great. But the syntax is unfamiliar to me and I can't find a reference for it. Here's what I have:
replacer = (x,y,z)=>LookupTable{[#"lookup value"=x]}?[replacement]? ??x
I have 3 questions about the above:
Solved! Go to Solution.
Hi @halifaxious,
There is a lot going on here
replacer = (x,y,z)=>LookupTable{[#"lookup value"=x]}?[replacement]? ??x
First this is a custom replacer function which takes 3 arguments:
x = original value
y = match condition (true or false)
z = replacement value
Next its applying (optional) key match lookup to identify a unique row in the table
LookupTable{ [#"lookup value"=x] }?
Followed by (optional) field access, to return a value from a field/ column
[replacement]?
And finally applying coalesce, to return the input value if a null is returned.
?? x
Ps. If this helps solve your query please mark this post as Solution, thanks!
Some links to resources on these topics:
Visual guide to key match lookup
Hi @halifaxious,
There is a lot going on here
replacer = (x,y,z)=>LookupTable{[#"lookup value"=x]}?[replacement]? ??x
First this is a custom replacer function which takes 3 arguments:
x = original value
y = match condition (true or false)
z = replacement value
Next its applying (optional) key match lookup to identify a unique row in the table
LookupTable{ [#"lookup value"=x] }?
Followed by (optional) field access, to return a value from a field/ column
[replacement]?
And finally applying coalesce, to return the input value if a null is returned.
?? x
Ps. If this helps solve your query please mark this post as Solution, thanks!
Some links to resources on these topics:
Visual guide to key match lookup
Thank you for a very illuminating answer! I wish I'd come here about 2 hours ago instead of fruitlessly googling.
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 5 | |
| 3 | |
| 3 | |
| 3 | |
| 3 |
| User | Count |
|---|---|
| 7 | |
| 6 | |
| 5 | |
| 5 | |
| 4 |