Forum Discussion

droad's avatar
droad
New Member
5 years ago
Solved

How to handle Multiple Tenants with Multiple Workspaces/Datasets?

Hi,

 

I am working on creating a multi-tenant SaaS application based on Power BI and Snowflake with the following structure (is very important to fully isolate data between tenants):

 

  • UI
    • Tenant 1 (Company 1)
      • user 1
      • user 2
    • Tenant 2 (Company 2)
      • user 3
      • user 4
    • ...
  • Power BI
    • Workspace 1 (for Company 1)
      • Report A
      • Report B
    • Workspace 2 (for Company 2)
      • Report A - equal to Report A used by Company 1
      • Report B - equal to Report B used by Company 1
    • ...
  • Snowflake DB
    • Database 1 (for Company 1) - connecting with DB_USER1
    • Database 2 (for Company 2) - connecting with DB_USER2

 

I need to reuse reports between tenants. So, onboarding a new tenant would look like copying the reports from an existing workspace BUT pointing these reports to a different Database in snowflake.

 

So, how can I use the same reports connected to different databases that have the same exact data model? Can I copy a Report from Workspace 1 to Workspace 2 and change the Database/User that will be used in Workspace 2?

 

Thanks.

  • droad's avatar
    droad
    5 years ago

    Thanks for your sugestion.

     

    However, because RLS is not what we want (we want to separate Tenant data in different Databases), I was able to find a different solution for this: at the Dataset level I created a Parameter that I use to define the Database name (one database per Tenant). Then, I just publish the report in multiple Workspaces normally. I can then change the parameter value in each workspace to be the correct value based on Tenant/DB Name.

     

    With this strategy, any further change to the report can be easly controlled because there is only one report.

2 Replies

  • Greg_Deckler's avatar
    Greg_Deckler
    Community Champion

    droad So, yes, you could save your PBIX file as a PBIT file. This saves it without the data but same everything else. Then you create a new PBIX file from this and point it to the new data sources. Presto, new report. 

     

    Now, this can be a maintenance nightmare because if you make a substantive change you would have to go back and update every report. Thus, if it fits within your constraints, I would recommend using Row Level Security (RLS). In this case you would import all of the databases into the same dataset and create roles with associated DAX rules. So, for example, you could have roles for each customer and a DAX rule like:

     

    [Customer] = "ABC Customer"

     

    Then they can all go the the same report but they will only see their data and not anyone else's data.

    • droad's avatar
      droad
      New Member

      Thanks for your sugestion.

       

      However, because RLS is not what we want (we want to separate Tenant data in different Databases), I was able to find a different solution for this: at the Dataset level I created a Parameter that I use to define the Database name (one database per Tenant). Then, I just publish the report in multiple Workspaces normally. I can then change the parameter value in each workspace to be the correct value based on Tenant/DB Name.

       

      With this strategy, any further change to the report can be easly controlled because there is only one report.