Forum Discussion
Dynamically change data source from SQL database
- 8 years ago
Hi @Cindy,
Some additions to the wonderful post of ImkeF. The feature changing parameters in the Service is on the way.
Another easier workaround is changing the parameters directly without a slicer.
Best Regards,
Dale
It's a bit of a hack on only works in Power BI Desktop, so not in the service: http://www.thebiccountant.com/2017/03/22/use-slicers-for-query-parameters-in-powerbi/
A different option would be to always load all tables into one big table with an additional column indicating the source.
The users can then do the same "source-selection" on the canvas and the data will be dynamically filtered instantly without having to refresh again.
- BusinessAnalyst8 years ago
Helper I
Dear Imke,
Thanks very much for your solution. The problem is tables on SQL server are generated on monthly basis only. It means that, we only have tables up till present, and no future tables. For example this month is April 2018, then there is no table for May 2018.
It’s fine if it’s only work on power bi desktop. My idea is that we don’t need to go back to advanced editor to edit the query (change month number) every much.
Cheers,
Cindy- ImkeF8 years ago
Community Champion
Especially with monthly tables I'd personally choose the large consolidated table-version instead.
Are you aware of parameters in Power BI? You can change them from the canvas-view as well without having to hack into your model.