How to prevent access to SSAS through visual studio? - powerbi

I have a typical fact table with dimensions Project, Profit Center, etc
In a report, I have a table visual that shows individual numbers; and another table shows the department numbers…
It looks something like this:
(Left: personal numbers. Right: department numbers)
My goal is that Tim shouldn’t be able to see someone else’s number, but he definitely can (and should) see the aggregated numbers for his department.
I realized that someone accessing from PowerBI or excel can connect to the model and play with the tables, pick another name and see someone else’s number, therefore I have hidden most tables...
But now, I just realized, someone with access can connect from Visual Studio to the SSAS:
The person can open the .bim, unhide all tables, and with the “analyze from excel” option in VS see any numbers…
Is there any way to avoid/prevent this?
More info:
My model:
(Project table has columns Lead1,Lead2,Lead3,Lead4,Lead5 and Lead6… Engagement Role is just an unpivot of this).
On my left visual I have:
(triggering a more restrictive access).
My RLS:

Is there any way to avoid/prevent this?
RLS will be enforced from every client experience, but RLS is never enforced for Workspace members with higher than Viewer permissions. See Using RLS with workspaces in Power BI
And hiding tables and columns is not a security measure. Hidden tables and columns can be used in DAX queries and measures.

Related

Is there a fast way to see all the active mesures in a Power BI report?

I am trying to siff through a large PBI report and for that I want to be able to determine the active measures and tables in the data model. In others words, I wanna be able to see what's being used from what's unused or obsolete in the model.
Is there, by any chance, a shortcut for that?
Thanks in advance
I think what you are after is RADACAD's amazing PowerBI Helper Utility.
This utility, once installed, is integrated in to the PowerBI external tools ribbon.
See the section at the link above around removing unused fields and measures.
Remove Not-used fields If there is a field not used in any visual, filter, or other calculations, then this is a safe field to be
removed. Power BI Help can identify these fields even if they are DAX
calculated columns or measures. Using the dependency tree of the
measure, it will identify if the field is used in another calculation
that is used in a visual or filter.

Power BI with SQL Analysis Services: how to "Hide" all not used tables from "Fields"

When I work in Power BI Desktop connected to SQL Analysis Services, my model looks like this,
Enter image description here
And the "Fields" tab on the right spans for more than a page long:
Enter image description here
In reality I actually use only a few tables and a few columns in those tables + my measures.
To simplify that look, I can go to ellipses near each tables title, and hide that particular table. I also can do this on "model" tab, but in my case, when I have a few dozens of tables, it is time consuming.
Is there a way how to "hide" all not used tables and columns, to help report consumers to comprehend the model and my calculations?
You can also easily hide multiple fields in Power BI Desktop. The best place to do that is to go into the Model tab. Then select all fields that you want to hide (using Ctrl or Shift with selection), and then in the Properties tab beside it, turn the Is Hidden property to On.

Is it possible to separate naming and identifiers or to use aliases in SSAS Tabular Models?

I work on a large SSAS Tabular Model with (SQL Server 2017). I've been looking for a way to be able to modify measures and other model elements without breaking the reports that rely on them. For instance, if I have a Net Turnover measure used in a PowerBI Report (w/ live connection to the model), and I change its name to Net Turnover (€), the report breaks because the name is used internally as and identifier.
Is it possible to change this behaviour, and to have an internal identifier that is distinct from the measure's name so as not to create breaking changes when modifying names?
Additionally, I was also wondering about the potential impacts of creating measure "aliases", for instance if I create a measure such as New Measure = Other Measure: I know this makes no difference in terms of storage since measures are calculated on the fly, but are there potential performance or other issues that may arise if I use such a technique?
Thanks in advance!
If your goal is to be able to change a measure name in the SSAS model and have that name change update all the reports built from that model, then I think you're out of luck since the measure name is its identifier (as you've noted).
On the other hand, if you're working with a specific report connected to an SSAS model and you want to display a different name for the measure, then you have more options.
The simplest is just to relabel the measure in the Values area of the visual to change how it appears in that visual. This renaming is localized to only that visual.
Create an alias measure as you've suggested in the report you're working on. The alias measure is localized to the report it's defined in. It can be reused across multiple visuals and pages of the report.
Create an alias measure in the SSAS model. This alias measure is then available to any report that connects to the SSAS model.
I can't think of any reason why creating alias measures would cause performance issues. It could potentially make things a bit more confusing having multiple measures for the same calculation but you can probably mitigate that by e.g. using display folders.

Power BI change original table name which is displayed in Daxstudio

I noticed very odd thing that Daxstudio allows you to view original table name. It is a bit niuanse because when you rename table created in M then Daxstudio still refers to it using original table name, not the new name. Here is how to reproduce the bug.
Power BI > Home > Enter Data
Name the table RedTable.
Run a query in Daxstudio:
EVALUATE
DISTINCT('RedTable'[Column1])
Now rename the table to BlueTable:
And run the query in Daxstudio for a new table name:
You can still see the original table name in the Query column of Server Timings.
Is there a way to change this original table name created with M?
I can add that this bug is applicable only to tables created with M (be it Enter Data or plug to Server). This bug is not reproducible with DAX tables. The DAX tables are updated after you change their name and actual (not original) name is display in Query column of Server Timings of Daxstudio.
This is not a problem of DAX Studio, even though we could try to fix it in DAX Studio. :)
Here is what happens: the Tabular model (used also by Power BI) has an ID for each object and then a Name. The ID is assigned by the Power BI and Visual Studio UI when you create an entity (table/column/...). Visual Studio shows the ID as a readonly property, whereas Power BI doesn't show that property at all.
The ID is used internally to reference the objects in the Tabular Object Model (TOM). It is also used to identify column in the interaction between Formula Engine and Storage Engine.
The Storage Engine queries captured by DAX Studio are messages intercepted with a debugging session connected to the Analysis Services session and in these messages the text represents entities (in particular table names) through their ID rather than through the Name property.
As Microsoft would say, this is "by design".
So far, DAX Studio simply capture the text of the storage engine queries and display this information.
However, DAX Studio "massages" the text, removing a lot of "noise" and making the query more readable. During this phase, it is possible to consider renaming IDs with Names.
I just created a feature request. That was easy. When to implement the feature, finding the time is much harder!

DAX studio showing additional (duplicate) local tables

My power Bi model contains the following tables:
However, when I connect to this model from DAX studio, I get the following:
Please note that all of these local date tables show the same metadata like the date table. Is this a potential problem? I believe this might be the reason behind this report working comparatively slow while development.
These tables show date tables automatically created by Power BI for all fields type "Date", to enable date hierarchy for them (year/quarter/month/day).
If you want to remove them, go to File/Options, then under "Current File" uncheck "Auto Date/Time":
These hidden tables will disappear. If you want to turn this feature off for all future/new files (I always do), uncheck a similar option under "Global".