A role and its filter
A role with one DAX filter, how that filter flows to the other tables, and how to see the report as the role.
Row-level security lets one semantic model and one report serve everyone, each person seeing only the rows that are theirs. It lives in the model, not in the report, so every visual, every page and every report on the model obeys it.
A role
In Power BI Desktop, open Modeling and choose Manage roles. Press New, name the role Austria, pick the Customer table and add a filter on Country. Or switch to the DAX editor and write it yourself:
[Country] = "Austria"A filter on a role is a DAX expression that is true for every row a member may see. Here that is every customer in Austria. Press Save.
How the filter flows
The filter is set on Customer, but the numbers live in Sales. It reaches them through the relationship: Customer filters Sales, one to many, the same way a slicer on Country would. So a member of the role sees only Austria's customers, and only their sales.
That flow is also the first thing to check. A table that no relationship reaches from Customer, a target table for example, is not filtered at all.
See it as the role
Open Modeling, choose View as, tick Austria and press OK. A bar at the top says you are viewing as the role. Add a card with this measure to be sure:
Customers seen = COUNTROWS ( Customer )With the role on, it counts only Austria's customers, and a table of sales by country shows one row. Press Stop viewing to see everything again.
Totals follow the role
A measure such as a share of the total is worked out inside what the role may see:
Share of sales =
DIVIDE (
[Total Sales],
CALCULATE ( [Total Sales], REMOVEFILTERS ( Customer ) )
)For the Austria role, REMOVEFILTERS takes away the report's filters, not the role's, so the share is of Austria's sales. Security filters cannot be removed by a measure, which is what makes them security.