Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi ,
I am looking to Parametrising (if it is a word like that) the datas source string in Power BI. I have added the server and db paramenter and the problem is , I have to change the source for example from Dev to Test.
Here is the step i have been through when you go thourgh get data wizard for sql,
typed in server ,
typed in database name and
then select list of views or table to load. In this load process the connection string is populated "for each table/view" in the M Query layer.
Do I need to change the stirng in each object in Advanced Query Editor ?
Shouldnt be a easy way to change source when you load the pibx file instead of meddling with M Query?
regards
Solved! Go to Solution.
HI @parry2k ,
Thanks for your reply. I got you. Turns out source cannot be parametrised , if we use Direct Query mode. In my case, as you guessed, data coming from single source but the source string is propagated in all tables under the Source Step.
I was hoping even in this case, I can replace the strings values to parameters on each table and change the source string in Power BI Service under Parameters.
But for direct query mode , Power Bi Service doesn’t even recognise the parameters from the pbix file. It is been listed in feature request.
Related articles
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
@Anonymous as you know that you can connect to multiple data source in same file , like sql server, share point, excel and so on, so basically there is connection string in each table. May be in you case you have one single source that is SQL server, you still need to update connection in each table. As you are using parameter, once you changed connection string, going forward it will be easy as everything will be driven from parameters.
I always use parameters when I start authoring reports coz I know most of the time when final report is built, data sources location potentially going to change.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
HI @parry2k ,
Thanks for your reply. I got you. Turns out source cannot be parametrised , if we use Direct Query mode. In my case, as you guessed, data coming from single source but the source string is propagated in all tables under the Source Step.
I was hoping even in this case, I can replace the strings values to parameters on each table and change the source string in Power BI Service under Parameters.
But for direct query mode , Power Bi Service doesn’t even recognise the parameters from the pbix file. It is been listed in feature request.
Related articles
https://powerbi.microsoft.com/en-us/blog/deep-dive-into-query-parameters-and-power-bi-templates/
@Anonymous
By the way, this is also mentioned here.
User | Count |
---|---|
141 | |
113 | |
104 | |
77 | |
64 |
User | Count |
---|---|
135 | |
123 | |
101 | |
71 | |
61 |