Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

How to connect the same report to different database depending on the user's credentials

Hello,

 

As asked in the title i want to connect my report to different database depending of the user.

 

Lets say i have 3 identical Databases (not same data), 1 for each client.

I have built a report that works fine by changing a parameter that contain the database name and refresh the dataset.

I want that change to be dynamic based on the user connecting to the report.

 

How can i do that?

How can i build a report that acces différents database depending of the user ?

I cant deploy the report for each client because i will have to do it again each time i update the report.

I cant have a single database for all clients.

 

I look like it's the same matter as this post : https://community.powerbi.com/t5/Developer/Switch-dynamically-between-the-databases-depending-on-user/m-p/2307464

If i cant change database on the dataset, is it possible to switch dataset depending on the user ?

 

I want to keep data separate and have only one report.

 

Thanks in advance.

 

 

4 Replies

  • Hey,

    Can you clarify whether the report is Direct Query or import mode?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Actually it's Import mode but if there is a solution with Direct Query i can rebuild the report to use it.

      • NandanHegde's avatar
        NandanHegde
        Super User

        Assuming that even though the databases are identical , the data among those databases are not same. Please correct my understanding here.

         

        So lets say we have table T1 in all 3 databases with diff set of data, so you need to pull table T1 from all 3 databases in a single PBIX file and then union those tables in a single dataset with a flag bifuracting the data mapping to the tables (the flag can be client names).

         

        Then create measures based on the final table and create a role to restrict the data to the specifc client based on the flag column.