Forum Discussion
zua
2 years agoFrequent Visitor
Power Query Parameter with default Value
Hello, is it possible in Power Query M to add a parameter to a function which has a default value? My goal is that if the function is called the parameter is shown with its default value, but ...
- 2 years ago
func = (param1, optional param2) => param1 + (param2 ?? 20), use1 = func(1, 10), // 11 use2 = func(1) // 21
zua
2 years agoFrequent Visitor
Hello AlienSx, thank you. But what should I do after I made the parameter optional. Can you give me an example?
- AlienSx2 years ago
Super User
func = (param1, optional param2) => param1 + (param2 ?? 20), use1 = func(1, 10), // 11 use2 = func(1) // 21- zua2 years agoFrequent Visitor
Thank you.
Is it possible that a number is displayed as the default parameter value,
when invoking the function.
Something like that, when "20" is already displayed when the function is called