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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Solution Specialist
Solution Specialist

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
Solution Specialist
Solution Specialist

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.