Forum Discussion
pmor
4 months agoFrequent Visitor
Dynamic Row Level Security for masking table column values
Hello Community, I have a PBI model which has a fact table with a column SiteID which is used to joined to a dimension table for further detail of the sites. Some sites are public and some are pr...
- 4 months ago
Thanks v-sshirivolu for that clarification. I can move on now. Cheers.
cengizhanarslan
4 months agoSuper User
Step 1) Create masked display columns in your dimension table
SiteID Display =
IF (
'Dim Site'[SiteType] = "Private",
"PRIV",
'Dim Site'[SiteID]
)
SiteName Display =
IF (
'Dim Site'[SiteType] = "Private",
"PRIV",
'Dim Site'[SiteName]
)
Step 2) Create an External role with OLS on the original columns
In Power BI Desktop → Modeling tab → Manage Roles → create a role named External. Apply OLS to hide the original SiteID and SiteName columns (and any other raw private columns) from this role. The masked display columns remain visible.
Step 3) Assign users to the correct role in Power BI Service
- External users → assigned to the External role in the semantic model security settings.
- Internal users → assigned to no role, or to a separate Internal role with no restrictions.
- Workspace admins and members bypass RLS entirely and see all data by default.
pmor
4 months agoFrequent Visitor
Thanks cengizhanarslan. This will be my fall back solution. I would prefer admins and member users to not have these columns visible as it becomes confusing. But it may not be helped.