I am using RLS in SSAS and it works fine:
I filter the table Project... Therefore, if a certain group has access only to Project X. They only see that.
(I use visuals in POWER BI that use a mix of fact measures with the Project dimension).
No issues there, the RLS works fine.
My question is: if the Project dimension is not pulled/used; the access does not get enforced... (I have control over POWER BI, and I pull/use the Project dimensions in all my visuals... But any user can connect to the model (through excel for example) and see ALL the data in the fact. How can I avoid this?
(I am not too worried, since in the fact I have mostly keys data, but they can still see 'revenue' for example...)
But any user can connect to the model (through excel for example) and see ALL the data in the fact. How can I avoid this?
If there's a filter path from Project to Fact, and you have RLS rules on Project Fact will be filtered for all users in the RLS role, regardless of whether they query Project directly.
Related
i am trying to change my database name in my advanced editor query in power bi. I know i can create parameters with in the power bi desktop app and pass the different database with in it. I have done this and it works fine.
But what i am trying to do is when i give a user a link for example
https://app.powerbi.com/groups/me/reports/DataSource="PowerBi_1"
how do i get the datasource name which is "PowerBi_1" and pass it into my advanced editor query which looks as follows
let
Source = Sql.Database(".", "PowerBi_2", [Query="select *#(lf)from Customer"])
in
Source
so i want to replace the Powerbi_2 with PowerBi_1
is this possible?
I tried searching and the only things i could find was to add parameters from "manage parameters" which i can already do. But i need it to be passed from the URL and automatically change the data source instead of manually changing it via "edit parameters"
i know you can use filter in your URL as https://app.powerbi.com/groups/me/reports/12345678-6418-4b47-ac7c-f8ac7791a0a7?filter=Customer/PostalCode eq '15012'
but this would only work on datasets. im not sure how to do this for a database change in a query
The only thing you could try is if you have a direct query and use the new feature of binding query parameters.
https://learn.microsoft.com/en-us/power-bi/connect-data/desktop-dynamic-m-query-parameters
Then you can set a filter with url to point to the database you need. Not sure how it would work - haven't tried it myself.
To expand on the idea a bit - you would need a table with database names in it. Then you would bind database column of that table to your query parameter and finally, use your url to set appropriate filter on this new table.
EDIT:
Scratch that, in the article I linked to, it says that direct query T-SQL is not supported. But if they were ;)...
I have setup my RLS quite successful. I collect the user who is logged on, have setup roles and also manage to limit rows to use in the reporting.
There is a field, that contains the row's responsible person (john#doe.com).
The DAX filter [RowResponsible] = [UsersEmail] works just fine.
The thing is, that the [RowResponsible] may contain multiple values. For example john#doe.com;jane#doe.com.
The DAX filter [RowResponsible] = [UsersEmail] will no longer work, obviously.
I'd like to be able to use some form of 'contains' in this filter, but SEARCH / CONTAINSSTRING will not do the trick (they seem to be not supported).
Any thoughts?
This following code should work for you as I am using a same code for one of mine RLS and its working fine-
CONTAINSSTRING(
[RowResponsible],
[UserEmail]
)
I am pretty new to RLS and have been trying to implement it in a certain way.
My table above is a sample. I am trying to create RLS here based on the levels. Normally I can create 3 roles for 3 levels where,
Level 1 is regular employees
Level 2 is supervisor of employees
Level 3 is the manager/head of the building (based on the BuildingID)
I am trying to create RLS where the manager (Level 3) will be able to see the data for people below them by filtering through. For example when the manager of BuildingID='233' logs in, they can filter through the report to see people they are assigned to.
It would be clickable in the filter pane. However, I am more used to on doing DAX calculations when the manager ID is on a different column and this seems to be a new scenario. I have tried a couple of methods and so far have not been successful. Any kind of help here would be much appreciated.
I could only advise you review something like this to see if you can use the comparable logic in your scenario https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi
I have a pbix file that takes an Azure Storage account as a parameter and reads data from there accordingly. The next step is to be able to embed this powerbi dashboard on a webpage and let the end user specify the storage account. I see a lot of questions and answers surrounding passing in filter query parameters--this is different, we're trying to read from a completely different data source and not filtering on a static data source.
Another way to ask this question is: is there a way to embed powerbi template files, if not, is there a feature request somewhere we can upvote?
The short answer is no.
There is a reason to use filters in this case instead of parameters. Parameters are something that is part of the report itself. Each users that looks at your reports will get the same parameter values as the others. If one of them changes some parameter, this will affect all other users. Filters on the other hand, is something local for your session. You can filter the report the way you like, and this will not affect other users experience in any way.
You can't embed templates, because template is simply a state of the report on the disk. When you open it, it's not a template anymore, but becomes a report.
You can either combine the data from all of your data sources in a single report, adding one more column to indicate from where this data comes from, and then filter on this new column. Or create/modify ETL process (for example dataflows can be used for this) to combine these data sources into a single one.
I find it difficult to wrap my head around developing a PowerBI visual from scratch. I was reading wiki, guide, inspecting examples, but still feel like there's a huge gap in understanding how it works internally - it did not 'click'. (I understand basics of how D3 works so not too worried about that part)
Question:
I hope I'm not asking too much, but could someone, using this barchart as an example, post a sequence of which methods in the visual source are called (and how the data is converted and passed) when:
The visual is added to the dashboard in PowerBI,
A category and a measure are assigned to the visual,
Data filter in PowerBI changes,
An element on our custom visual is selected.
Your option which you think may be relevant
I used this specific visual as an example because it was mentioned as meeting minimum requirements for contributing a new custom visual, which sounds like a good starting point, source:
New Visual Development
Please follow our minimum requirements for implementing a new visual. See the wiki here.
(the link references the barchart tutorial)
However, if you have a better example visual - please use that instead.
This is all I got:
Many thanks in advance.
I also have some extra and more generic additions:
Power BI uses the capabilities.json structure to determine a) what should be data pane (dataRoles) and how Power BI bind that data to your visual (dataViewMappings) and b) what can be shown in the formatting pane (e.g. placeholders).
the enumerateObjectInstances() is an optional method that is used by Power BI to initialize the formatting pane. The structure returned by this method should be equal to the structure in the capabilities.json file.
the update() method (required) is called when something is changing regarding your visual. Besides databinding changes, also a resize of the visual or a format option triggers the method.
the visualTransform() method is indeed an internal method and not directly called by Power BI. In case of the BarChart it is called by the update() method so the arrow is correct. Most visuals have some kind of method and it is used to convert the Power BI DataView structure to the internal structure (and sometimes to some extra calculations).
Both the constructor and the update() method have parameters (options) which provides callback mechanisms to Power BI, like the ISelectionManager (via options.host.createSelectionManager()), which alters the interaction of the visual with the rest of the Power BI visuals.
The structure of how custom visuals are interacting with Power BI hasn't changed that much since the beginning. Only with the new API the interaction and possibilities has changed: is used to be an open world, but now it is limited.
Hope this helps you in gaining a better overview of a Power BI custom visual.
-JP
A few comments on your graphic. You are obviously using the view model (good):
After any data change, filter change, or object change (format in your pic), visualTransform() is called. The data comes in odd formats so will need repackaging (for anything other than simple). That gets done here and a data object that the developer defines gets returned. I build this data object as an array because d3 loves arrays.
update() is then called (I think your arrow in the pic here is the wrong way around). This is slightly tricky because d3 interaction now comes into play. If you have used d3().enter (and you probably have) then that executes only once so on a subsequent PBI update() only d3() non-enter instructions are followed. If you put everything in d3().enter then any subsequent data update won't appear to work.
Alternatively you can d3().remove() and rebuild the svg on each PBI update(). Whether this is practical will depend on your data and the visual.
Thank you for having a crack at documenting the flow. MS documentation is very lame at the moment.