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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Ruthwiksai_2021
Frequent Visitor

Can we use CONTAIN or CONTAIN STRING DAX in Row level security.

Hi

 

I have attachted the screen shot below. I have Business group column there i have semicolon values like beauty wellbeing:personal care so when i use below it is saying format error. Is there any other way acheive this rquirement.

 So my goal is the when user login they can see beauty wellbeing, personal care vaues in drop down slicer. you can see error in below screen shot.

 

I am using below DAX for Role

[Business Group]= CONTAINS(AD, [Business Group], "Beauty & Wellbeing") || CONTAINS(AD, [Business Group], "Personal Care")

 

Ruthwiksai_2021_0-1692364128130.png

Ruthwiksai_2021_2-1692364689713.png

 

Ruthwiksai_2021_1-1692364626031.png

 

Thanks in Advance

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

Here is one way to do this. Instead of CONTAINS you can use SEARCH:

ValtteriN_0-1692366004311.png

Dax:

IFERROR(SEARCH("Personal Care",[Business Group]),FALSE())
||
IFERROR(SEARCH("Beauty & Wellbeing",[Business Group]),FALSE())

ValtteriN_1-1692366559126.png

 

ValtteriN_2-1692366573429.png

 

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/






Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi

 

it is working in Power BI desktop in manage role but when i am trying in Azure analysis services it is not reflecting. it is showing all values Business group column.

I am using this below dax code in AAS.

=IFERROR(SEARCH("Personal Care",DimCategory[Business Group]),FALSE()) || IFERROR(SEARCH("Beauty & Wellbeing",DimCategory[Business Group]),FALSE())

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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