<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Calculated column checking the current RLS Role in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/1761550#M36859</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Not very clear to me.&lt;/P&gt;
&lt;P&gt;ISFILTERED() is to check if a column filtered by slicer or filters &lt;/P&gt;
&lt;P&gt;Yes, Username and userprincipalname work only with measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure I got your issue completely. But these are good RLS articles&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns-in-Power/td-p/712613" target="_blank"&gt;https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns-in-Power/td-p/712613&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi" target="_blank"&gt;https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies" target="_blank"&gt;https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/service-admin-rls" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/service-admin-rls&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://blog.tallan.com/2018/04/10/row-level-security-in-power-bi-part-1-roles-and-users/" target="_blank"&gt;https://blog.tallan.com/2018/04/10/row-level-security-in-power-bi-part-1-roles-and-users/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi" target="_blank"&gt;https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 02 Apr 2021 11:32:45 GMT</pubDate>
    <dc:creator>amitchandak</dc:creator>
    <dc:date>2021-04-02T11:32:45Z</dc:date>
    <item>
      <title>Calculated column checking the current RLS Role</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/1761475#M36853</link>
      <description>&lt;P&gt;Hello everyone, I'd like to add a calculated column to a table, setting TRUE or FALSE depending on the value of current role in use.&lt;BR /&gt;This table is not RLS filtered itself, but it must get some information from an other table contening a list of roles and which is filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;That seems simple but the problem is :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;1) the DAX function ISFILTERED() doesn't detect that a table is RLS filtered;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;2) PowerBi forbids you to use the USERNAME() function in a computed column (only in a measure - that is absurd), and it seems there is no function giving you the current role in use&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;3) apparently you cannot use a computed column (from an other table) to test the contents of RLS Filtered table (for example with IF() and CONTAINS() DAX functions).&lt;BR /&gt;It seems that during table load phase, the tables are first fully charged, and RLS filtering applies only after.&lt;BR /&gt;The result is that the computed column (checking for a certain role) allways returns TRUE, as during evaluation the RLS filtered table is found complete and not yet filtered.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is not a simple issue. PowerBi Documentation is very poor about this subject.&lt;/P&gt;&lt;P&gt;Thank you in advance if someone has an idea.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 10:34:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/1761475#M36853</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-04-02T10:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column checking the current RLS Role</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/1761550#M36859</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt; , Not very clear to me.&lt;/P&gt;
&lt;P&gt;ISFILTERED() is to check if a column filtered by slicer or filters &lt;/P&gt;
&lt;P&gt;Yes, Username and userprincipalname work only with measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I am not sure I got your issue completely. But these are good RLS articles&lt;/P&gt;
&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns-in-Power/td-p/712613" target="_blank"&gt;https://community.powerbi.com/t5/MBAS-Gallery/Microsoft-Power-BI-Unleash-row-level-security-patterns-in-Power/td-p/712613&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi" target="_blank"&gt;https://radacad.com/dynamic-row-level-security-with-organizational-hierarchy-power-bi&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies" target="_blank"&gt;https://www.blue-granite.com/blog/using-dynamic-row-level-security-with-organizational-hierarchies&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/service-admin-rls" target="_blank"&gt;https://docs.microsoft.com/en-us/power-bi/service-admin-rls&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://blog.tallan.com/2018/04/10/row-level-security-in-power-bi-part-1-roles-and-users/" target="_blank"&gt;https://blog.tallan.com/2018/04/10/row-level-security-in-power-bi-part-1-roles-and-users/&lt;/A&gt;&lt;BR /&gt;&lt;A href="https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi" target="_blank"&gt;https://radacad.com/what-do-you-need-to-implement-dynamic-row-level-security-in-power-bi&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Apr 2021 11:32:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/1761550#M36859</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2021-04-02T11:32:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculated column checking the current RLS Role</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/2199094#M51574</link>
      <description>&lt;P&gt;Fully agree,&amp;nbsp;Anonymous&lt;/LI-USER&gt;.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I am generally at a loss for something equivalent to Tableau's very clear description of its order of operations / query pipeline. I think this documentation will help clarify the nature of the question,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt;: &lt;A href="https://help.tableau.com/current/pro/desktop/en-us/order_of_operations.htm" target="_blank" rel="noopener"&gt;https://help.tableau.com/current/pro/desktop/en-us/order_of_operations.htm&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;I did some similar testing to try and discover whether RLS filtering would be applied before or after evaluation of a computed column, finding that the column evaluation happens first, then RLS filtering is applied.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;It would be great if this order were the other way around, which I think is also required to be able to use USERPRINCIPALNAME(), etc., within a computed column.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This would be great to solve for use cases where you want to use a centralized data model but be able to customize reports to a degree for different users. This could reduce a lot of duplicate work and development, as one single data source and report could cater to a greater variety of audiences.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In my particular use case, I want to populate a column DYNAMIC_DIMENSION with different dimensions based on who is logged in. Let's say if a top-level director is logged in, we want to show a bar chart broken out by Region and then a Regional Manager could be shown the breakout by offices.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;This could be achieved in a computed column, alongside RLS rules, to populate that DYNAMIC_DIMENSION column accordingly. That column would, of course, be used as the axis for the bar chart.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Nov 2021 18:38:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculated-column-checking-the-current-RLS-Role/m-p/2199094#M51574</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-11-19T18:38:53Z</dc:date>
    </item>
  </channel>
</rss>

