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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
arpost
Post Prodigy
Post Prodigy

Using new CustomData() with PBI RLS

I saw this blog post on the PBI blog about the CustomData functionality and was curious how this works. I have a report in which we are passing a user email as an identity via the traditional RLS route, but I was wondering if CustomData can simultaneously be used to pass a filter criteria (e.g., useremail: [email protected], CustomData: Category A).

 

If yes, can more than one thing be passed via CustomData?

 

I had hoped the Embedded doc on this would address the new capabilities with CustomData, but this doc is outdated and hasn't been updated since 12/9.

2 REPLIES 2
Garrysfarrell
Frequent Visitor

Hi I know this is a little late for you, however I thought this may help others. The answer to the first question is yes. Passing the username (this can be text like a userID for app owned data embedding or an email) and CustomData simultaneously is valid. I used them in different roles, remember the embedded code will send the role name.

The answer to the second question is yes. The text string is limited to 256 chars at the moment and only one string. So when using the ContainsString function you can parse it for serval values. This code goes in the role code Country Role: ContainsString(CustomData(),[Country])

The string passed could be a country or a list eg USA,FRA,ENG,AUS

The string passed could be a country list and the user's age eg USA,FRA,ENG,AUS,40

Age Role: ContainsString(CustomData(),[Age]) (the [Age] column will need to be a text data type)

Note: ContainsString() can be a performance issue, so test and use it to filter smaller tables.

v-yanjiang-msft
Community Support
Community Support

Hi @arpost ,

This feature has been announced for a relatively short period of time, and there is still relatively little description about it. Maybe for some of its unknown functions, you can also test it or vote this idea in Power BI ideas Forum and add your comments there to improve Power BI. 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.