Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin 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.
Creating a new post as my previous one had red herrings (what I thought was the issue turned out not to be the issue).
I have a report with visualizations from two different related tables. Obfuscating, Table1 is a distinct list of buildings and a series of its attributes (e.g. square footage, occupancy limit). Table2 is an unpivoted list of teams and the buildings they occupy. One team may occupy multiple buildings, and one building may have multiple teams, so both columns have non-distinct text values.
Table1[Building] Table2[Building]
1 : *
Table1
|
Table2
|
The report has visualizations based on values from both tables: cards with summed square footage, a table with many of the building attributes, etc. I have a slicer on Table2[Team] and it functions perfectly - I can filter by 1+ teams and all visualizations update accordingly, including those which only show Table1 building data. I'm trying to achieve the same thing with RLS: create roles for each team such that they'll arrive to the report with the data pre-filtered, unable to see data for buildings they don't occupy. A DAX for Table2 is easy enough, but only restricts access to visuals using T2 data. Whenever I try to apply a DAX to Table1 based on Table2 team name, I get a "cannot resolve to a single value" error. I'm hoping someone can point me to the (probably obvious) thing I should be doing instead.
Thank you!
Solved! Go to Solution.
Hi @EWright06
You can place a RLS Filter rule on Table1 similar to this example (for a role where only the "Development" team is visible):
VAR TeamList =
{ "Development" }
RETURN
CALCULATE (
NOT ISEMPTY ( Table2 ),
TREATAS ( TeamList, Table2[Team] )
)
This tests whether Table2 is nonempty with the relevant Team filter applied, along with a filter corresponding to the current row of Table1 (due to CALCULATE).
Note that RLS filter expressions are evaluated for each table independently, in an "unfiltered" context.
Does this or something similar work for you?
Hi @EWright06
You can place a RLS Filter rule on Table1 similar to this example (for a role where only the "Development" team is visible):
VAR TeamList =
{ "Development" }
RETURN
CALCULATE (
NOT ISEMPTY ( Table2 ),
TREATAS ( TeamList, Table2[Team] )
)
This tests whether Table2 is nonempty with the relevant Team filter applied, along with a filter corresponding to the current row of Table1 (due to CALCULATE).
Note that RLS filter expressions are evaluated for each table independently, in an "unfiltered" context.
Does this or something similar work for you?
Thank you so much, it works!
To make sure I'm understanding why it works, is this rule effectively:
I'm missing where it then evaluates the current row's T1[Building] value - is that part of the TreatAs, Calculate, or built-in logic to the RLS expression itself?
Thank you again!
-Eric
Glad to hear it 🙂
Youre explanation above is essentially correct!
I'll just explain the DAX code in my own words in case it helps:
A simpler version with the same effect for a single Team could be:
CALCULATE (
NOT ISEMPTY ( Table2 ),
Table2[Team] = "Development"
)
Regards,
Thank you, your framing got things to click in place for me - especially in the simpler formula, which I've substituted since roles will only be assigned a single team.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
14 | |
9 | |
7 | |
7 | |
6 |
User | Count |
---|---|
21 | |
11 | |
10 | |
9 | |
8 |