Forum Discussion
Anonymous
7 years agoNot applicable
None option in a parameter
Hello, To simplify my problem, let's pretend that I am using accounts data. Each account has a type : A, B or C. I am using a parameter which filters my data according to these three types. To do ...
- 7 years ago
Hi Anonymous
Sure, you can use the exaple below.
Parameter query.
"none" meta [IsParameterQuery=true, List={"none", "A", "B", "C"}, DefaultValue="none", Type="Text", IsParameterQueryRequired=true]Table query
let Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [types = _t]), #"Changed Type" = Table.TransformColumnTypes(Source,{{"types", type text}}), #"Filtered Rows" = if Parameter = "none" then #"Changed Type" else Table.SelectRows(#"Changed Type", each [types] = Parameter ) in #"Filtered Rows"Hope this helps!
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.
Mariusz
7 years agoCommunity Champion
Hi Anonymous
Sure, you can use the exaple below.
Parameter query.
"none" meta [IsParameterQuery=true, List={"none", "A", "B", "C"}, DefaultValue="none", Type="Text", IsParameterQueryRequired=true]Table query
let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WclSK1YlWcgKTzkqxsQA=", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type text) meta [Serialized.Text = true]) in type table [types = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"types", type text}}),
#"Filtered Rows" = if Parameter = "none" then #"Changed Type" else Table.SelectRows(#"Changed Type", each [types] = Parameter )
in
#"Filtered Rows"Hope this helps!
Best Regards,
Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.

Mariusz
If this post helps, then please consider Accepting it as the solution.
Please feel free to connect with me.