Power BI Activity Log UpdateWorkspaceAccess - powerbi

When calling
Get-PowerBIActivityEvent -StartDateTime ($start) -EndDateTime ($end) -ActivityType UpdateWorkspaceAccess
I expected to get all changes to workspace access across all workspaces, similar to activity type ViewReport gives me all report views. For some reason it seems to return activity for the user I'm currently logged in as. Can't find any detailed docs on how UpdateWorkspaceAccess is supposed to work.
Grateful for any pointers.

Well normally this works for me
Get-PowerBIActivityEvent -StartDateTime 2021-12-21T00:00:00 -EndDateTime 2021-12-21T18:00:00 -ActivityType viewreport | Out-File –FilePath C:\Users\Administrator\Desktop\Process.json
You can also use Power BI Rest API :
GET https://api.powerbi.com/v1.0/myorg/admin/activityevents?startDateTime={startDateTime}&endDateTime={endDateTime}&continuationToken={continuationToken}&$filter={$filter}

Related

How to prevent unwanted access to Fact table?

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.

Power BI Embedded Analytics Client API: "FailedToValidateDataRole" when calling visual.AddDataField()

I am attempting to add data to a blank Visual using Power BI Embedded Analytics Client API. The visual is type "card".
I am calling visual.AddDataField("Fields", ...) in my JavaScript code
This produces the following error:
FailedToValidateErrorRole Screen shot
Is Fields the correct first parameter here? This is the name of the field when using PowerBI itself:
Power BI card example screen shot
After looking here:
https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/get-visual-capabilities
I added the following line to my source code:
let capabilties = await this.visual.getCapabilities();
Then I was able to see what the data role was that it was expecting which was actually Values
Once I used this it worked.

RLS path calculation

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

PowerBI: How to use TupleFilter with powerbi-client?

I am trying to use TupleFilter in powerbi-client, since I need to filter data based on two different columns with OR statement between them (2 different columns in the same table or may be in 2 different ones), check this question out.
As I read in this docs, tuple filter can do this.
However, when I tried to use it with report.setFilters(filters) function, I got this error from setFilters function: "undefined property is invalid".
Moreover, I didn't find the function used in the above docs in powerbi-client:
visualHost.applyJsonFilter(filter, "general", "filter", FilterAction.merge)
So, I just tried setFilters(filters).
Getting deeper in the filters docs, I found this:
Report level filter supports the following types: IBasicFilter |
IAdvancedFilter | IRelativeDateFilter.
Page level filter supports the following types: IBasicFilter | IAdvancedFilter | IRelativeDateFilter.
Visual level filter supports the following types: IBasicFilter | IAdvancedFilter | IRelativeDateFilter | ITopNFilter | IIncludeExcludeFilter.
So, what I couldn't understand, how to use Tuple Filters if none of the above filter levels support it!
Tuple filter is not supported for embedding
You read correctly, TupleFilter is not supported in any filter level. It's an API used by Power BI visuals - so it can be used to create custom slicers (such as HierarchySlicer - it may solve your issue btw).
Currently however, tuple filters aren't supported for Power BI filters at all, so can't be used with powerbi-client - which deals with embedding a Power BI "element" (report, dashboard, visual etc.) inside a web page or application.
Note that tuple filter support for powerbi-client may be added in the future.
Full disclosure: I'm a Microsoft employee, working in one of Power BI's development teams. No affiliation with HierarchySlicer visual.

PowerBI EnableFolding

September update have changed how to consume data from Postgres.
M code will change to something like this:
Value.NativeQuery(PostgreSQL.Database("server", "db"), "query", null, [EnableFolding=true])
How can I change to function as before the update?
PostgreSQL.Database("server", "db", [Query="query"])
Or now I would need to do it manually?
Regards,
Finally Microsoft gave me the workarond: just remove [EnableFolding=true] from query, advance editor (the one showing the m language)
Right yesterday I went into the same issue.
Data refresh now works only from desktop while fails for any new query created with latest Power BI once published on service.
Tried to set EnableFolding=false and EnableFolding=none as error message suggests but both throwing a error.