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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
jay3828
Frequent Visitor

dynamic m query with parameters getting an error "The import vendorList matches no exports."

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

jay3828_1-1689688071309.png

 


my parameter is called Vendorname 

jay3828_0-1689688032048.png

 

 

 

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

 

 

1 REPLY 1
ppm1
Solution Sage
Solution Sage

Please see if this video helps. It shows simpler syntax and a similar scenario.

https://www.youtube.com/watch?v=ilTeVH2Cwck

 

Pat

Microsoft Employee

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors