Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Parametising choice for different data sources within query

Hi.   Just wondering if it's possible to parametise the selection of different data sources for queries. In production we are using Dataflows that are sourced from a production database, but we'd l...
  • Anonymous's avatar
    Anonymous
    6 years ago

    How i would solve this in Power Query is as follows (I've not used dataflows so please let me know if this doesnt work).

     

    Create 2 Queries, set as enable load = false (Also known as Expressions in Analysis Services).

    1. source_Production
    2. source_Test

    These queries should be a source row to your specific database.  If its SQL it just the table listing, but not the navigation step

     

    Create Your Parameter, as a logical.  I called mine fromTest

    Have your source row in your standard queries look like this

     

     

    Source = if fromTest then source_Test else source_Production

     

    Any gateways required will need credentials for both systems and be aware that should test go offline, you could potentially get refersh errors.