It is possible to hide tables in Power BI by using the “Hide in report view” option, however, if a user downloads the PBIX file this is still possible to view hidden tables or to unhide tables and this is also true for the reports with a live connection to SSAS or PBI dataset.
In this post, I’m going to show another way to hide tables in Power BI which prevents users or anyone to view the hidden tables.
Table of Contents
Hide tables in Power BI
To hide tables in Power BI we can either do it from the Model view or directly from the Report view.
Once done we can see the hidden icon enabled on the table “v_dimDate”
And once we open the Report view we can no longer see the hidden table, so far so good?
Well until your users get access to the PBIX file and discover the option to unhide tables or to view hidden tables.
Unhide all and View hidden
As mentioned at the beginning of this post once we get access to the PBIX file of a report or even if we have a live connection to a tabular model or a PBI dataset it is possible to view the hidden objects.
As we can see the table “v_dimDate” is now visible even though we’ve hidden the table
Prevent users from viewing hidden tables using Private
Once the model is opened via tabular editor we have access to the Tabular Object Model (TOM) properties and we can modify them. The property that we need to change is “Private” once we set private to True the table becomes hidden and can no longer be seen in Power BI even when we enable “ViewHidden” or “Unhide all”.
The only drawback is that once the Private property is set to True Power BI will think that this table does not exist and thus the IntelliSense will not work anymore. As Power BI no longer recognise this table it will also highlight in red this table in any formula but we can ignore it as the formula will still work.
As we can see the “v_dimDate” is no longer visible even after we enable the “View hidden” option and even though Power BI does not recognise this table we can still reference it in any DAX formulas.
If the developers are developing directly into Power BI it is probably a good idea to temporary set Private to False while developing and set it back to True before publishing or sharing the file.
This option can be very useful when it comes to hiding the tables used to configure Row Level Security or any other internal tables that we don’t want users to see.
Of course, this technique does not replace the Object Level Security and should not be used for such a purpose and as a best practice, I’d always recommend not to give access to the underlying model of a report to the users and always use the Live connection whenever it’s possible.
Finally, to learn more about the Tabular Model I’d highly recommend to take the “mastering-tabular” course from SQLBI.