Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
arpost
Post Prodigy
Post Prodigy

Anyone know how to create a custom function with optional values in the query itself?

Greetings, community. Have a problem and am hoping a Power Query/M guru out there can help me.

 

I'm trying to create a custom function from a query and cannot figure out how to make it so any parameters used in the query are optional WITHOUT breaking the connection between the function and the query.

 

As an example, I have a super basic query with a single step:

 

arpost_0-1687363746295.png

 

This query uses a parameter called Param that is a decimal type.

 

arpost_1-1687363778969.png

 

When I tried to make the parameter optional in the custom function, I get a warning that this will break the link to the query:

 

arpost_2-1687363836985.png

 

Does anyone know of a way to make a parameter optional in the query itself? Or do we always have to break the function-query connection to alter parameters like that?

1 REPLY 1
gafoorgk
Frequent Visitor

I was going to ask the same question, then found this post where no one answered. Seems this is not possible in Power Query even when a parameter is created with 'Required' option is turned off. Only option is to break the connection. That would make updating function a bit tedious process.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.