Forum Discussion
Parametising choice for different data sources within query
- Anonymous6 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).
- source_Production
- 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_ProductionAny gateways required will need credentials for both systems and be aware that should test go offline, you could potentially get refersh errors.
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).
- source_Production
- 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.
This is a great pattern. I would just add, parameters in dataflows can't be changed from outside dataflows (yet), so I would use another dataflow to store my true/false value, and then reference that as if it were the parameter.