Forum Discussion

Sujith_00's avatar
Sujith_00
Advocate I
1 year ago
Solved

Dynamic DB Connection Switching Based on Location Slicer in Power BI

Hi everyone!   I have an interesting challenge I'm hoping to get some guidance on. I have a Power BI report currently connected to a SQL Server database. I also maintain an Excel file that contains...
  • parry2k's avatar
    1 year ago

    Sujith_00 Dynamic db connection is not an issue, the only challenge here is that the connection needs to switch based on the selection made by the user. The only thing I can think of is to use dynamic M parameters which will pass the location to PQ and then further logic will change the connection. Read more about dynamic M parameters here Dynamic M query parameters in Power BI Desktop - Power BI | Microsoft Learn

     

    The only other way or a more scalable way I can think of, combine data from all the sources (SQL databases) and add a location column to the data, and based on the slicer, it will filter data for the specific location. This is a more practical solution. But it also depends on the size of data if you have to combine it form the all the SQL servers.