Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
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 the value can be changed.
Something like that even if it does not work: (param1, param2 = 20, param3) => ...
Is this possible?
Thank you!
Solved! Go to Solution.
func = (param1, optional param2) => param1 + (param2 ?? 20),
use1 = func(1, 10), // 11
use2 = func(1) // 21
Hello @AlienSx, thank you. But what should I do after I made the parameter optional. Can you give me an example?
func = (param1, optional param2) => param1 + (param2 ?? 20),
use1 = func(1, 10), // 11
use2 = func(1) // 21
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
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
15 | |
11 | |
8 | |
8 | |
7 |
User | Count |
---|---|
15 | |
13 | |
9 | |
6 | |
6 |