Can I use DAX to apply row-level security by matching a substring in the username to a column value

0 votes

Can I use DAX to apply row-level security by matching a substring in the username to a column value?

I'm implementing row-level security in Power BI and want to grant access to rows based on whether the logged-in user’s username contains a specific substring that matches values in a column. I need to know if DAX can handle this kind of partial match for dynamic security rules.

9 hours ago in Power BI by Evanjalin
• 34,450 points
9 views

1 answer to this question.

0 votes

Yes, you can implement row-level security (RLS) in Power BI using DAX with substring matching via the USERNAME() function and SEARCH().

Example DAX RLS Filter Rule

Assume you want to match part of the username to values in the [RegionKey] column:

SEARCH([RegionKey], USERNAME(), 1, 0) > 0
  • USERNAME() returns the full UPN (e.g., user@domain.com).

  • SEARCH() checks if [RegionKey] appears anywhere in the username.

  • > 0 ensures a match; 0 means not found.

answered 9 hours ago by anonymous
• 34,450 points

Related Questions In Power BI

+1 vote
2 answers
0 votes
1 answer

How can I get a column value from previous row in Power Query?

Hi Sindhu, add this line as your ...READ MORE

answered Mar 18, 2019 in Power BI by Cherukuri
• 33,050 points
8,801 views
0 votes
1 answer
0 votes
1 answer

In DAX, how do I RETURN the sum of a calculated column from a DAX Table Variable (created via ADDCOLUMN)?

You can access column variables of previously ...READ MORE

answered Oct 8, 2020 in Power BI by Gitika
• 65,730 points
4,946 views
0 votes
1 answer

Displaying Table Schema using Power BI with Azure IoT Hub

Answering your first question, Event Hubs are ...READ MORE

answered Aug 1, 2018 in IoT (Internet of Things) by nirvana
• 3,090 points
1,802 views
+1 vote
1 answer

Unable to install connector for Power Bi and PostgreSQL

I think the problem is not at ...READ MORE

answered Aug 22, 2018 in Power BI by nirvana
• 3,090 points
3,168 views
+2 votes
2 answers

Migrate power bi collection to power bi embedded

I agree with Kalgi, this method is ...READ MORE

answered Oct 11, 2018 in Power BI by Hannah
• 18,520 points
1,969 views
+1 vote
1 answer

Connect power bi desktop to dataset and create custom reports

Open power bi report nd sign in ...READ MORE

answered Oct 10, 2023 in Power BI by Monika kale

edited Mar 5 2,164 views
0 votes
1 answer

I need to calculate a running total but reset it at the start of each new quarter—how can I achieve this in DAX?

To calculate a running total that resets ...READ MORE

answered Mar 7 in Power BI by anonymous
• 34,450 points
296 views
0 votes
1 answer

How do I calculate the most frequently occurring value in a column using DAX?

To find the mode in a column, ...READ MORE

answered Apr 1 in Power BI by anonymous
• 34,450 points
422 views
webinar REGISTER FOR FREE WEBINAR X
REGISTER NOW
webinar_success Thank you for registering Join Edureka Meetup community for 100+ Free Webinars each month JOIN MEETUP GROUP