Forum Discussion
Select all parameter
- 2 years ago
You're close. Remember that you can represent a single value as a list too. That way you don't need to cover multiple scenarios.
let Source = {"2024","2025"}, RList = if Value.Is(Source, List.Type) then Source else {Source} in Text.Combine(RList,",")I have set the select all value to 12 in the table (Pbi desktop view)Not recommended. The "All" scenario is automatically included if you use a regular filter.
let
SelectID = if Value.Is(test,List.Type) then test else {test},
Res = "'" & Text.Combine(test,"','")&"'" ,
Source = Value.NativeQuery(Snowflake.Databas ********** and soo on
" ... Where YEAR in ( " & Res & " )"Thx again lbendlin .
When i see the code from you now it makes sense .
i am affraird that i get an error that i am trying to understand :
Expression.Error: We cannot convert the value "2024" to type List.
Details:
Value=2024
Type=[Type]
- lbendlin2 years ago
Super User
you are missing the curly brackets.
else {test}- Wresen2 years ago
Post Patron
lbendlin
i really appriciate your help and i hate to argue with you 🙂
This is how it looks,
let
SelectID = if Value.Is(test,List.Type) then test else {test},
Res = "'" & Text.Combine(test,"','")&"'" ,
Source = Value.NativeQuery(Snowflake.Databa ****** and so on
in (" & Res & ") ", null, [EnableFolding=true])
in
Source
and i get the error :
Expression.Error: We cannot convert the value "2025" to type List.
Details:
Value=2025
Type=[Type]- lbendlin2 years ago
Super User
Needs to be a text value, not a number.
let
Source = "2024",
RList = if Value.Is(Source, List.Type) then Source else {Source}
in
Text.Combine(RList,",")