Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

Parametrize an OLE datasource for DEV/PROD env

Hi there

 

We have 2 environments QA and Prod and a single report. The schema and tables in both environments are same and data is different. Ideally, I would use a parameter to switch between the data sources but this is OleDb not SQLServer, so I can't.
Of course, I can modify my source like this:

 

 

let
    Config = GetConfigString(),
    Source = OleDb.DataSource(Config, [Query="SELECT DISTINCT#(lf)sys_ObjectId as ID, Name#(lf)FROM Category"])
in
    Source

 

 


but then I can't plan a refresh since the datasource "can't be build".

So can I use a template and then change my source ? 

5 Replies

    • Anonymous's avatar
      Anonymous
      Not applicable

      I do use query parameters, but I cannot use them for building a OLE DB connection string

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi Jimmy

       

      Thanks for your reply. To rephrase what I have wich works perfectly well:

       

      let
          StringCon = "provider=QOle.6.6.3.37;mode=Read;initial catalog='catalog';data source=tcp://server:25780/QEF/Instance",
          
          Source1 = OleDb.DataSource(StringCon, [Query="SELECT Id, Name FROM Category"]),
      
          Source2 = OleDb.DataSource("provider=QOle.6.6.3.37;mode=Read;initial catalog='catalog';data source=tcp://server:25780/QEF/Instance", [Query="SELECT Id, Name FROM Category"])
      in
          Source2

       

      The thing is this Source1 - unlike Source2 - is not "buildable", there is no wheel icon on the right :

       

      This means I cannot build a gateway on Power BI service.

       

      • v-yuta-msft's avatar
        v-yuta-msft
        Icon for Community Support rankCommunity Support

        Anonymous ,

         

        I would suggest you create a support ticket here for further analysis.

         

         

        Community Support Team _ Jimmy Tao

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.