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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
bobceres
New Member

RLS with DAX for String with Multiple Values

I have a report that is utilizes security from defines roles within our salesforce CRM solution. Essentially, for the RLS, we have DAX code that looks at the username and checks against the user’s company organization to only show them records that pertain to their organization.  However, every organization has several sales codes.  Currently, when someone has access to an organization, they can see records for all sales codes. 

To go one step further, we are passing a string that includes the username, the company organization, and the sales codes.  When a user has access to only one sales code, the report is filtered correctly.  However, when the report is passed multiple sales codes, the report is blank.

 

This is what I am using currently to filter at the organization level:

 

bobceres_0-1643306730195.png

 

 

I have tried the following for capturing multiple strings and it did not work:

 

bobceres_0-1643377027997.png

 

An example of the string I am trying to parse it the following:

 

ExampleCompanyName;00512000008ARcPAAW;011045000,074047000

I changed the company name, the value after the ; is the userid value and the two values after userid are sales codes the user would have access to.  We receive these values from Salesforce.

 

What would I need to do to filter at [Sales Code] that would show multiple values if the user has access to more than 1 sales code?

1 REPLY 1
lbendlin
Super User
Super User

You can treat PATHITEM(3) as its own PATH. (a PATH in a PATH, so to speak). But it would still require hardcoded logic based on PATHLENGTH.

 

It would be easier if the sales codes per user would be held in a reference table.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors