<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Tushar Bedekar on Medium]]></title>
        <description><![CDATA[Stories by Tushar Bedekar on Medium]]></description>
        <link>https://medium.com/@tusharbedekar?source=rss-580972e930b6------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*7hj2HzUEyE0IszP_</url>
            <title>Stories by Tushar Bedekar on Medium</title>
            <link>https://medium.com/@tusharbedekar?source=rss-580972e930b6------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 17:35:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@tusharbedekar/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[How to apply Row Level Security (RLS) & Column Level Security (CLS) on Power BI Datasets.]]></title>
            <link>https://medium.com/@tusharbedekar/how-to-apply-row-level-security-rls-column-level-security-cls-on-power-bi-datasets-c7b8510c98d6?source=rss-580972e930b6------2</link>
            <guid isPermaLink="false">https://medium.com/p/c7b8510c98d6</guid>
            <category><![CDATA[pbi-cls]]></category>
            <category><![CDATA[power-bi-rls]]></category>
            <category><![CDATA[power-bi-cls]]></category>
            <category><![CDATA[cl]]></category>
            <dc:creator><![CDATA[Tushar Bedekar]]></dc:creator>
            <pubDate>Fri, 14 Nov 2025 13:34:17 GMT</pubDate>
            <atom:updated>2025-11-14T13:34:17.597Z</atom:updated>
            <content:encoded><![CDATA[<p><em>By </em><a href="https://medium.com/u/580972e930b6"><em>Tushar Bedekar</em></a><em> &amp; </em><a href="https://medium.com/u/6c27dbbfbaec"><em>Syed Abdul Anees Baba</em></a></p><p><em>While working with Power BI Datasets/Semantic Models, there are often situations where we have to secure the data for the right user base. Natively, Power BI allows pretty robust Row Level Security (RLS). RLS can be both Static &amp; Dynamic; however, mostly for corporate engagements and enterprise implementation, Dynamic RLS is used heavily.</em></p><p><em>While working on one of the projects, we came across an interesting use case where we had to implement Dynamic Row Level Security. Additionally, we had a situation where we had to secure Column data due to the sensitivity of the content. Column Level Security (CLS) is natively not present in Power BI. The requirements were not to break the visual while restricting column content on reports/dashboards, so usage of Object Level Security (OLS) was not something that would have solved the problem for our project.</em></p><h3><strong><em>How we overcame this?</em></strong></h3><p><em>We implemented Row Level Security using DAX to secure row-level data, and we established a relationship as shown below. DAX which was used for securing data is also shown as an example.</em></p><p><em>For securing column data both we worked with Data Engineering (DE) team of source system and ensured an Index column (Unique Identifier) is provided with each of row on the table which Power BI will import/consume.</em></p><p><em>Our solution involved separating sensitive columns into separate tables for each of these sensitive columns while importing the data into Power BI and establishing relationship with main table using this Index Column. This Index column helped us in ensuring there is no data duplicity and/or data mismatch.</em></p><p><em>Example below shows structure of Sales Fact table (SALES_FACT) with sensitive column “revenue” separated table (SALES_SENSITIVE).</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/990/1*dTrlUodMhNdiB23GIOyw1Q.png" /><figcaption>Sensitive Column “revenue” separated as separate table from Sales Fact.</figcaption></figure><p><em>Once this is achieved, we used Security tables containing data for both Row Level Security (RLS_USER_TABLE) &amp; Column Level Security (CLS_USER_TABLE).</em></p><p><em>Upon importing these tables our revised model was as below.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/930/1*Xgp-qg1TLFfS_bl6G2iM-w.png" /><figcaption>RLS &amp; CLS Tables Imported in Power BI Model</figcaption></figure><p><em>RLS_USER_TABLE contains data of users who should have access for Row Level Security. Here User ID column shows Microsoft 365 UPN ID and Prompt_Type is field used for defining policy for Row Level Security.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/282/1*RFf5koF9vRGwzuZPYwHArg.png" /><figcaption>Example table used to manage RLS.</figcaption></figure><p><em>CLS_USER_TABLE contains data of users who are considered privileged users to view data on the sensitive column “revenue”. Here User ID is Microsoft 365 UPN ID and Revenue Field (Sensitive Column) is marked Yes or No based on privilege.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/250/1*EKjvXGhBaptesEP1hhbmwQ.png" /><figcaption>Example table used to manage CLS.</figcaption></figure><p><em>Observation &amp; applied change — In the first screen shot we have had 1:1 relation between main table (SALES_FACT) and sensitive table (SALES_SENSITIVE). However, we noticed a situation where because of cardinality set as 1:1, Cross Filter Direction defaults to “BOTH” without option to change it.</em></p><p><em>If data of user is not present in CLS_USER_TABLE data of Fact Table was also getting “&lt;blanks&gt;” as there was entry only in RLS_USER_TABLE and not in CLS_USER_TABLE.</em></p><p><em>To overcome this situation as there will be use-case where there will be users will be having access on RLS table so they are privileged to see those rows, however they are not in CLS table so they could not see “sensitive” columns, we changed the relationship between SALES_FACT &amp; SALES_SENSITIVE from </em><strong><em>1:1 to 1:* (1:Many) </em></strong><em>with Cross Reference Filter set to “Single</em><strong><em>.</em></strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/831/1*QJSy-tfKlvM3bpUczJ6xlw.png" /><figcaption>Revised relation between fact and sensitive table and changed Cross-filter direction.</figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/983/1*akUguWILBk-D0Pg1r_wfSQ.png" /><figcaption>Changed Relation from 1:1 to 1:*</figcaption></figure><h3><em>Sample DAX used for RLS &amp; CLS implementation with above setup</em></h3><p><em>DAX sample for Row Level Security (RLS) should be applied only on Fact table (SALES_FACT) in modeling → under manage roles</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lSM58r18GlGvCGsYnJA9Sg.png" /><figcaption>Sample DAX for RLS</figcaption></figure><pre>VAR _Restriction =<br>    CALCULATETABLE(<br>        VALUES(RLS_USER_TABLE[Prompt_Type]),<br>        RLS_USER_TABLE[User ID] = USERPRINCIPALNAME()<br>    )<br>RETURN<br>    IF(<br>        COUNTROWS(_Restriction) = 0,<br>        FALSE(),<br>        IF(<br>            &quot;All&quot; IN _Restriction,<br>            TRUE(),<br>            [promo_type_1] IN _Restriction<br>        )<br>    )</pre><p><em>DAX sample for Column Level Security (CLS) should be applied only on Sensitive table (SALES_SENSITIVE) in modeling → under manage roles</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*owJGCDcXXgwlNAdDu6SPTw.png" /><figcaption>Sample DAX for CLS</figcaption></figure><pre>var _Restriction =<br>CALCULATETABLE(<br>VALUES(CLS_USER_TABLE[Revenue]),<br>CLS_USER_TABLE[User ID]=USERPRINCIPALNAME()<br>)<br>var RLS_Restriction =<br>SWITCH(<br>TRUE(),<br>_Restriction = &quot;Yes&quot;, TRUE(),<br>FALSE()<br>)<br>Return<br>RLS_Restriction</pre><p><em>Once this is done, both RLS and CLS is applied on the model and user will only see rows where they have privileges and column data will be visible to users with CLS applied.</em></p><p><em>If user have access to row but not the sensitive column, Power BI will not break the visual but will show “&lt;blank&gt;” values instead. This is effectively solving our issue of report getting errored out.</em></p><p><em>With this we managed to create reports as per our requirements and without using multiple views to show/hide data.</em></p><h3><strong>Final Output</strong></h3><p><em>After applying all these above steps, below is example reports showing CLS and RLS applied simultaneously.</em></p><p><em>XYZ@constoso.com is having access for sensitive columns and for RLS he has row level access on PR01 &amp; PR05 on field “Prompt_Type_1” from SALES_FACT table, as also mentioned in screenshot above.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/579/1*WMR11-xCZiLHmDhLVqSYTA.png" /><figcaption>RLS/CLS applied in parallel with user having access on Sensitive column.</figcaption></figure><p><em>ABC@constoso.com is not having access for sensitive columns and for RLS he has row level access on PR04 &amp; PR11 on field “Prompt_Type_1” from SALES_FACT table, as also mentioned in screenshot above.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/613/1*4TmVNXzQpdt-NQ8iEBQC6Q.png" /><figcaption>User ABC does not have access to Sensitive Column so Sum of Revenue column shows blank.</figcaption></figure><h3><strong>P.S.</strong></h3><ol><li><em>Our requirement was limited to 10–12 sensitive columns, so this solution is tested for performance and maintenance for up to 15 columns only. Maintenance of tables become too complicated for more than 15 sensitive columns.</em></li><li><em>The solution only works when in visual, atleast one aggregated column is present, we noticed if it is not present this solution does not work at all. Please consider this as well. We were not able to find fix for it yet.</em></li></ol><h3><strong>About Us</strong></h3><p><a href="https://www.linkedin.com/in/bedekar/">Tushar Bedekar</a> is a Platform Architect specialized in Microsoft Azure solutions ranging from Microsoft 365 to Azure landscape implementation.</p><p><a href="https://www.linkedin.com/in/syed-abdul-anees/">Syed Anees</a> is a Power BI implementation specialist with wide experience in deploying reporting solutions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c7b8510c98d6" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>