Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredJoin us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.
I am trying incorporate paramers in my power bi reports. I am using the snowflake connector and trying to add the select all to my query and running into issues. Note. M code is not my specialty. here is the code. looking for some help. Thanks all.
my table where the list comes from is Vendor List
my parameter is called Vendorname
let
vendorListSelected = if Type.Is(Value.Type("VendorName"),List.Type) then
Text.Combine({"'", Text.Combine(vendorList,"','"), "'"})
else Text.Combine({"'",VendorName,"'"}),
vendorListAll = if Type.Is(Value.Type("VendorName"),List.Type) then
List.Contains(VendorName, "all") else
false,
query = "Select lower(rtt.username) as ""userid"",#(lf)upper(fc.vendororganizationname) as Vendor,#(lf)rtt.sessionkey as ""Session Key"",#(lf)rtt.roundtriptime as ""Latency"",#(lf)rtt.sessionstarttime,#(lf)Date(rtt.sessionstarttime) as dateonly,#(lf)time(date_trunc('minute',rtt.sessionstarttime)) as timeonly#(lf)from eux_prd_eudl_db.ctx_views.ctx_sessionrtt_utc rtt#(lf)join eux_prd_eudl_db.ctx_landing.sg_full_contractorexpress fc on lower(rtt.username) = lower(fc.domainuserid)#(lf)where fc.vendororganizationname <> 'null' and length(fc.vendororganizationname) > 1#(lf)and fc.vendororganizationname is not null and rtt.username is not null and length(rtt.username) > 1 and (length(rtt.sessionkey) > 1)#(lf)and rtt.sessionstarttime >= dateadd('DAY',-14, current_date)",
filter = if vendorListAll then " "
else Text.Combine({" AND upper(FC.VENDORORGANIZATIONNAME) IN (", vendorList, ")"}),
finalquery = Text.Combine({query,filter}),
Source = Value.NativeQuery(Snowflake.Databases("uhgdwaas.east-us-2.azure.snowflakecomputing.com","EUX_PRD_CTX_LOADER_MEDIUM_WH"){[Name="EUX_PRD_EUDL_DB"]}[Data], finalquery, null, [EnableFolding=true])
in
Source
Please see if this video helps. It shows simpler syntax and a similar scenario.
https://www.youtube.com/watch?v=ilTeVH2Cwck
Pat
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.