Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
roelverm
Regular Visitor

Pass array in dynamic RLs with embedded report

I have a PowerBI report embedded in a webapplication.

 

Authorization and authentication is managed in a separate application and provides us with the information to generate the embed token.

 

I have created a role called 'insitution ID' which filters the institution table based on the Id's which a user is allowed to see. This information is however not in my powerBI model nor do I want to recreate this in my model as this would create duplicate maintenance.

 

Users can however have access to multiple institution IDs and this is where I can't get DAX to work as I can only pass a single value

See example below

{

"accessLevel": "View",
"identities": [

{
"username": "12345" --> here I would need multiple values
"roles": [ "InstitutionID"],
"datasets": [ "fe0a1aeb-f6a4-4b27-a2d3-b5df3bb28bdc" ]
}

]

}

 

See my dax formula

roelverm_0-1681742628907.png

 

I have tried using an IN operator, but this isn't compatible with the username() function

roelverm_1-1681742673989.png

It does work to have multiple values when I hard code

roelverm_2-1681742715935.png

 

 

Is there any way to pass on multiple institution IDs via the username() function or alternatives which don't reqiure me to have an additional table in my model linking the users with all possible institution numbers.

 

Note that the amount of numbers could go up as high as 100.

 

Many thanks

 

 

 

6 REPLIES 6
IainColledge
Frequent Visitor

Did you ever resolve this please as we're facing the exact same situation of needing to pass multiple values to filter on with an "embed for customer" solution?

Anonymous
Not applicable

Hi @roelverm ,

If 23846 and 23853 are user ids, you can update the formula as below. Later check if it can return the expected result...

vyiruanmsft_0-1681871467866.png

In addition, you can refer the following links to get it.

Dynamic RLS - use DAX to return multiple values IN

[Region]
    IN CALCULATETABLE (
        VALUES ( UserList[Region] ),
        FILTER (
            ALL ( UserList ),
            [User email] = USERNAME ()
                || [User email] = USERPRINCIPALNAME ()
        )
    )

Dynamic Row-Level Security in Power BI with Exclude and Include Rules - RADACAD

[ID] IN
SELECTCOLUMNS(
FILTER(
'User Profile',
Related(User[Email])=UserPrincipalName()
),
'ID',[Profile])

Configuring "all" access with dynamic row-level security 

Best Regards

Hi @Anonymous ,

 

Thanks for your help, but unfortunately this does not do the trick. The numbers are not user ID, nor do I have a user table as this report will be embedded. I just receive a list of these numbers every time a users logs in via the source application and these numbers should filter the output school table

Looking at the documentation I can only pass a single value, not multiples, but this seems strange as you can have multiple values using the IN statement but this is not compatible with the username() function.

All other examples you provide seem to all work with a user table. If this is really the only way I could check to bring the user table over from the source application, but this seems data duplication and not ideal from maintenance perspective to keep it up to date.

 

Kind regards,

Roel

 

Hello,

I have the same issue. Did you make this working? 

Best Wishes,
Jacek

Hello @roelverm !
I am faced with the same use case, did you ever figure out a way to do it?

It seems to be a common issue, having to pass multiple values to filter on, anyone resolve it?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.