Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
I've experimented, but I have not come up with a solution for this scenario:
My Custom function accepts three parameters, the last two of which are optional. I want to pass parameters one and three only. How do I call the function?
Solved! Go to Solution.
Make sure that your second argument has no type. You will then be allowed to pass a null value as the second option.
Make sure that your second argument has no type. You will then be allowed to pass a null value as the second option.
Thanks Mike - back to the rescue!
That works indeed. Testing further, i found that this will also work with passing null, and with the added benefit of validating the data type of the parameters:
(P1 as text, optional P2 as nullable text, optional P3 as nullable text) =>
let
T1 = "P1 = " & P1,
T2 = if (P2 = null) then "; P2 = null()" else "; P2 = " & P2,
T3 = if (P3 = null) then "; P3 = null()" else "; P3 = " & P3,
Return = T1 & T2 & T3
in
Return
Hey J, I forgot that you could use nullable text. I wish more of the standard PQ functions would use them.
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 | |
| 4 | |
| 3 | |
| 2 | |
| 2 |
| User | Count |
|---|---|
| 11 | |
| 10 | |
| 8 | |
| 7 | |
| 7 |