Forum Discussion
Issue with the UserID parameter in local report vs Published report in PowerBI Services
Hi,BharathM .I am glad to gelp you.
The problem you are experiencing often occurs when setting up dynamic RLS in power bi (setting up RLS for .rdl files/pbix files)
I think a good suggestion for this solution is to add a user mapping table to your paginated reports
This is used to map the power bi service account that the user logs in with to a local domain username.
(This allows you to indirectly use the local domain name to set up the RLS, but actually use the Power BI Service account)
User logs into Power BI Service > user table maps to local domain name based on Service account name > displays the data that the actual user should see based on the domain name.
The reason for the problem is that the UserID expression in the paginated reports does not return the same result in the local domain (Power BI Report Builder) and in the cloud (Power BI Service).
This is also described in the official documentation given (essentially you should use the power bi service account as a judgment condition for RLS if you want the user to access the report in Power BI Service and not in Power BI Report Server)
PS: In Power BI Report Server, the reports you produce are perfect because the UserID always returns the local domain name.
Hopefully my test below will help you out!
You need to create a user mapping table
Map the user's service account to the local domain when the user accesses the paginated reports.
Hopefully the following issue will help you Hopefully my test below will help you.
You need to create a user mapping table
When a user accesses a paginated reports, the user's service account is mapped to the local domain.
Solved: Data masking in paginated reports - Microsoft Fabric Community
like this:
The Mapping table you need to create
INSERT INTO UserMapping (ServiceAccount, LocalDomain)
VALUES ('[email protected]', 'VM0/admin01');
You may need to create new parameters to appropriately modify your screening logic.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- BharathM1 year agoHelper IV
Hi Anonymous I have added new datasets.
In these, we have UserID and EmailID.
Now, please tell me the parameter logic. How should I create the parameters? For the existing datasets, we don’t want to change the MDX query. The UserID will need to be passed in those datasets. Can you please provide the logic?