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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
ecoquelet
Frequent Visitor

Select all values parameter in Power Query

Hello !

 

I have some data that I need to be able to filter by country. So, I've created a parameter for it by getting a list of distinct values from the Country column, then I modified the query in editor by placing the parameter name in filtering step.

This works fine, however I'm wondering :

 

Are there any possibility to get an option of selecting all the values from the list of countries or desactivate the Parameter, so I can also keep all the data if needed ? 

 

Thank you in advance !

1 ACCEPTED SOLUTION
ChielFaber
Super User
Super User

I Think you can make this work. You can create something like this

 

First create a new parameter which only has the options true/false (TRUEFALSE_param)

false meta [IsParameterQuery = true, IsParameterQueryRequired = true, Type = type logical, List = {true, false}, DefaultValue = false]
 
As a second step you can create a blank query with an  if statement with the original paramater field (countries list)
 
if TRUEFALSE_param = true then Text.From(Countries_parameter) else "
[Columname] <> null and [Columname] <> "")
 
Then in the filter you could just use the Text.From function with this query as a source.
 
I used something similar in a native.sql query in Dataflows.
 
 

[Tip] Keep CALM and DAX on.
[Solved?] Hit “Accept as Solution” and leave a Kudos.
[About] Chiel | SuperUser (2023–2) |

View solution in original post

2 REPLIES 2
Syndicate_Admin
Administrator
Administrator

Power BI:
Table.SelectRows(#"Change type", if ParmChooseCountry = null then each [Country]<>ParmChooseCountry else each [Country]=ParmChooseCountry)

ChielFaber
Super User
Super User

I Think you can make this work. You can create something like this

 

First create a new parameter which only has the options true/false (TRUEFALSE_param)

false meta [IsParameterQuery = true, IsParameterQueryRequired = true, Type = type logical, List = {true, false}, DefaultValue = false]
 
As a second step you can create a blank query with an  if statement with the original paramater field (countries list)
 
if TRUEFALSE_param = true then Text.From(Countries_parameter) else "
[Columname] <> null and [Columname] <> "")
 
Then in the filter you could just use the Text.From function with this query as a source.
 
I used something similar in a native.sql query in Dataflows.
 
 

[Tip] Keep CALM and DAX on.
[Solved?] Hit “Accept as Solution” and leave a Kudos.
[About] Chiel | SuperUser (2023–2) |

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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