Forum Discussion

AG_PBI's avatar
AG_PBI
Frequent Visitor
1 year ago
Solved

Passing Parameter to warehouse

Hi, For managing dashboards, we have created a dev workspace and a prod workspace. I created all datasets in warehouse: dataflow (source data) -> Warehouse (stored Procedure) -> Pipeline (to run the...
  • v-ssriganesh's avatar
    v-ssriganesh
    1 year ago

    Hi AG_PBI ,

    Thank you for your questions. I’d like to clarify a few points regarding your setup:

    1. The variable name you choose (e.g., wsId or ConnectionString) does not impact functionality as long as it is used consistently throughout your queries. The key is to ensure that the value assigned accurately reflects the connection string for your environment (Dev or Prod). You appear to be using the server information from the semantic model correctly, but please ensure that the connection strings in your parameters match the server details for each environment.
    2. The Current Value setting in Power BI Desktop specifies which value the parameter will use during development. Once published to the Power BI service, you can override this Current Value with a different setting for the same parameter. This flexibility allows you to maintain a single PBIX file while managing different environments (Dev and Prod) within the service.
      • Setting the Env parameter directly in the Power BI service will take precedence over the value set in the PBIX file during report refreshes. This is particularly useful for managing deployments without needing to republish the PBIX file.
    3. If removing the if statement resolved your refresh errors, it indicates that the parameter setup in the service was not compatible with the logic in your query. By directly using IDs for Dev and Prod, you have simplified the logic, which can streamline your workflow.
    4. The parameters defined in the PBIX file and the settings in the Power BI service can interact, but the service settings will override the parameters in the PBIX. For example, if you publish a PBIX with a Current Value set to DevId but later change the Env parameter in the service to ProdId, the service will utilize ProdId for refreshes.

    I hope this addresses your concerns. If you have any further questions or need additional assistance, please do not hesitate to ask. Kindly Accept this as a solution and give it a “Kudos” so others can find it easily.
    Thank you.