Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
We have PBIRS server setup and we are using rdl and pbix files on there. The Report Server is embeded into a web app which various users use. We need to be able to restrict what each user sees on the paginated reports and the Power BI reports. For the paginated reports we are using the Built-In field of UserId. Is this available on the Power BI reports too, or is it restricted to just the paginated reports?
Thanks in advance.
@mpsrshl Thank you for the reply, we have tried this but unfortunately the user details are the Windows credentials used to access the tabular model rather than the user who is logged into the web app.
There is a similar function you can use in Power BI reports. See Row-level security in Power BI Report Server
You can use username() . Be aware that username() has the format of DOMAIN\username within Power BI Desktop. Within the Power BI service and Power BI Report Server, it's in the format of the user's User Principal Name (UPN). Alternatively, you can use userprincipalname(), which always returns the user in the format of their user principal name, username@contoso.com.
Thanks for the response, we have considered this but as we have hundreds of clients with multiple users we can't feasibly setup the number of Windows accounts it would need. Is the UserPrincipalName taken from the Windows credentials? And how would this be visible to us in Power BI Desktop please?
@TKenny90 wrote:Thanks for the response, we have considered this but as we have hundreds of clients with multiple users we can't feasibly setup the number of Windows accounts it would need. Is the UserPrincipalName taken from the Windows credentials? And how would this be visible to us in Power BI Desktop please?
This should be no different than how you've setup the paginated reports. You mentioned you have hundres fo clients, how do you intend to setup security for them if you don't want to create those accounts? The user accounts should exist somewhere to be able to use them in Power BI.
We set permissions in a web app as to which branches a user can see. The user has an ID in the web app which is then fed through to a paginated report via custom auth. We pick this up in the UserId field (normally where I'd see the Windows user) for paginated reports and use this to filter branches based in what they can see in the web app. I was hoping I would be able to pick this UserId in a PBI report as I can the paginated reports?
The paginated reports and PBI reports both have Windows credentials to return the data from the data sources, which is one account per customer for us.
I hope this helps, you can create the following role inside the PBI file, considering you are using the window user.
[EmployeeID] =
MAXX(
FILTER (
all('Employee'),
'Employee'[Email] = USERPRINCIPALNAME ()
|| 'Employee'[LDAPAccountID]
= MID ( USERPRINCIPALNAME (), 1, FIND ( "@", USERPRINCIPALNAME (), 1 ) - 1 )
),
'Employee'[EmployeeID]
)
I think you should be able to make it work. I haven't done something like this myself but see this forum post - Custom Authentication in PowerBI
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
3 | |
2 | |
2 | |
1 | |
1 |
User | Count |
---|---|
5 | |
5 | |
4 | |
4 | |
4 |