Forum Discussion

Sanjota05's avatar
Sanjota05
Frequent Visitor
5 months ago
Solved

Dynamic M query parameter binding to a query table which uses import mode

At the moment I am using a dynamic M queries within a SQL queries which is in import mode. I have 9 custom sql queries where the data is being filtered in these queries by adding parameters in where clause to filter the data. 

 

These parameters are created in power query and I am using it in slicer so that once I select other values the data should be loaded based on the parameter value selected. I am using SQL server.

 

I am not able to see bind to parameter in modelling for import mode, I can only see bind option to direct query.

 

1. Bind to parameter functionality will be enabled only for  Direct query?

2. I have tried to load the data in direct query but when I create parameter and use it in SQL query in M query the storage mode is automatically import mode. Why the storage mode is choosen as import mode ?

 

Why there is no option to change storage mode to direct query?

 

 

 

 

  • Hi Sanjota07 ,


    Non-null assertion failure: resource: Resource should be available for query Query2 to store FoldedArtifacts in cache This corresponds to that the pbi engine cant fold the entire query in direct query mode so this flag is raised 

    You can also try this approach :
    let
    Source = Sql.Database("",""),
    PrCase = Source{[Schema = "dbo", Item = "Table"]}[Data],
    FilteredRows = Table.SelectRows(PrCase, each [Active] = #"Active")
    in
    FilteredRows

    Thanks

26 Replies