Skip to content

Restrict rows with a security rule

4 min read · Updated 6 Nov 2026

One semantic layer usually serves people who should not all see the same rows. A security rule restricts a table’s rows per person, so a regional manager and a national director can open the same workbook and each get their own numbers, without a second copy of the model.

A rule is a condition on a table’s Pre-filter that compares one of the table’s fields with an attribute of whoever is asking: their email address, or the groups they belong to. The attribute is resolved when the query runs, which is what separates a security rule from an ordinary pre-filter. A condition compared against a value you type in is not a security rule — it restricts everyone identically.

Security rules have no tab of their own; you set them on the table. In Map View, the Add menu lists Security Rule under Governance, and it points you at the table rather than opening an editor of its own.

The Add menu on Map View open, with Security Rule outlined under the Governance heading

Before you start: open a semantic layer, and know which field carries the value you will match — a column of email addresses, or a column whose values are named the way your groups are.

Write a security rule
  1. The Customers table's property panel open beside Tables & Fields, with its Pre-filter section collapsed

    A security rule belongs to the table it restricts. Select the table in Semantic Model → Tables & Fields or in Map View: its panel has a collapsed Pre-filter section, with no count while the table has no conditions.

  2. The Pre-filter section expanded on a table that carries no conditions yet

    Expand Pre-filter: it already holds one blank condition reading New filter — click to edit, with Add filter below it for a second and the Apply as global data reduction checkbox, which makes a restriction follow the joins. Select the blank condition.

  3. The field picker open over the new condition, listing the two columns of the Customers table

    Open Select a field and choose the column the rule reads, one whose values are named like your groups, then the operator beside it. The picker offers only this table’s own columns.

  4. The new condition bound to the segment column, with its comparison still set to Value

    In the value row, change Value to User Attribute: a typed-in Value restricts everyone identically, and blocks Update while the box is empty.

  5. The condition comparing segment against $userGroupNames, with Limit to groups reading All of the user’s groups

    Choose the attribute the column is compared against: $userGroupNames comes with In list, or Exclude from list, and an empty Limit to groups tests every group the person belongs to. Select Update in the footer; Cancel discards the change.

  6. The Customers row in Tables and Fields carrying both the pre-filter funnel and the security shield

    Customers now carries a shield beside its funnel: the funnel marks a pre-filter of any kind, the shield marks one compared against a user attribute. The edit is saved locally until you publish.

$userEmail is a single value and takes a wider set of operators than $userGroupNames: Equals and Excludes, the text matches Contains, Not contains, Like and Not like, and the four ordering comparisons from Less than to Greater than or equal.

A condition with no value blocks the save. Update stays disabled while a pre-filter condition is missing its value, and says so when you hover it. Fill the value in, or remove the condition.

Selecting Add filter again adds a second condition. The badge down the left of the group reads AND, and selecting it switches the group to OR — which on a security rule widens what comes back rather than narrowing it.

While the attribute is $userGroupNames, Limit to groups appears under the condition. Left empty — it reads All of the user’s groups — the rule tests every group the person belongs to. Open it to search the list, select a listed group to take it off, or type a name and select Add.

Limit to groups open under a condition on $userGroupNames, with Finance and Sales added and the box for adding another group by name

A group name cannot contain a comma. The list is stored as a single comma-separated value, so a name with a comma in it would come back as two groups and widen the rule; the editor refuses it instead.

Apply as global data reduction, at the foot of Pre-filter, turns the restriction into one that follows the joins: the tables connected to this one through the join graph return only rows that survive it.

Strict appears while the reduction is on, and is ticked when you apply the reduction. With it on, any query that reaches the joined tables is limited, including a list of dimension values. With it off, only queries with measures from those tables are limited, so a dimension-only query, such as a list of values, can still return every value. Keep Strict on for a security rule.

The foot of Pre-filter with Apply as global data reduction switched on and the Strict option that appears beside it, both outlined

The reduction reaches tables that carry no rule of their own. On the map those tables show the pre-filter glyph as well, and only its tooltip names the table the reduction came from. Check what is in the join group before you turn it on.

A shield appears beside Pre-filter while any condition there compares against a user attribute, on the table’s header in Map View, and beside the table in Tables & Fields. Selecting the shield on the map selects that table, so you can open its Pre-filter and read the rule.

Map View with the header of the Customers table outlined, carrying the security shield and the pre-filter funnel

Tables & Fields with the security shield outlined beside the Customers table, after the pre-filter funnel

The funnel glyph says less: it marks a pre-filter of any kind, whether or not a user attribute is in it, so a table carrying a security rule shows both. Its tooltip says Pre-filter active.

An inline table and a custom SQL table have no Pre-filter section — a custom SQL statement already carries its own filtering. Where Business Questions are enabled for your workspace, Filter source lets a table use a stored filter in place of conditions written here; those conditions are then edited in Business Context → Reusable Filters.

A security rule decides which rows a permitted query returns. It does not decide who can open the semantic layer at all — see Manage resource access, and How access works for planning the groups a $userGroupNames rule reads. For how the rule is stored in the model, see filters, table limits and row-level security.

Like every other edit, a rule stays in the draft until you publish. Nobody else’s rows change before that.

Next: Publish your changes.