<?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: Rank changes when RLS is applied in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976032#M43500</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are absolutely right. The only one way to do it so that it's dynamic is to make&amp;nbsp; a copy of the fact table and the dimensions which are being affected by RLS and then use TREATAS to move relationships from one sub-model to another. Yes, this will certainly work but your model... well, it'll at least double in size. If you can afford it, no problem. If the ranks were static, you could do with calculating them in PQ. But here it's no option &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; So, you'll have to live with duplication of the fact table.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Jul 2021 14:56:16 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-07-23T14:56:16Z</dc:date>
    <item>
      <title>Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1820382#M38616</link>
      <description>&lt;P&gt;Hi Team,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 3 tables&lt;/P&gt;&lt;P&gt;Accountid table (used for RLS)&lt;/P&gt;&lt;P&gt;Dealer Master table&lt;BR /&gt;Fact sales tables&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am showing ranking of dealers based on their sales quantity.&lt;/P&gt;&lt;P&gt;I also want to apply RLS in my dataset since there are user who have access to particular dealers data only, but when I apply RLS the ranking is calculated on the filterted data instead of whole set of data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the ranking of dealer when RLS is not applied&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;When RLS is applied on account id :&amp;nbsp;2347, below is the result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;But my intended result should be rank for &lt;STRONG&gt;dealer A should be 2 and for dealer F 5.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Even though dealers get filtered due to RLS, Rank should be calculated based on All dealer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Note: I cannot hardcode rank using a calcualted coulmn as I have date slicer and rank will change when date slicer is used.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have attached the pbix with sample data below.&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1gqeOrSuY7f2mhc7Kp7bQm9XsblThm51R/view?usp=sharing" target="_blank" rel="noopener"&gt;Sample PBIX&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 May 2021 17:54:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1820382#M38616</guid>
      <dc:creator>Senthil_Kumar</dc:creator>
      <dc:date>2021-05-03T17:54:37Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1822275#M38658</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="299453" data-lia-user-login="Senthil_Kumar" class="lia-mention lia-mention-user"&gt;Senthil_Kumar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I'm not 100% sure but I think it's not possible. When you apply RLS, it means that the current user CAN'T SEE data rows that get filtered out. It also means that DAX just excludes the filtered out rows from any analysis---it treats them as if they are just not there. You can't through DAX "unhide" the rows for the duration of the calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Think about it this way. If you have 2 countries, the USA and the UK, and the user has only permissions to view data that belongs to the USA, then there is no way to somehow hack into data from the UK.&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 11:54:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1822275#M38658</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-04T11:54:34Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1822671#M38670</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp; Thanks for the reply.&lt;BR /&gt;Yes, its difficult to bypass RLS.&lt;/P&gt;&lt;P&gt;I was thinking of an altenative but I am stuck with implementation. Not sure if this is doable.&lt;/P&gt;&lt;P&gt;I created 2 Dealer table, one name Dealer_Table_RLS which I have modeled wtih RLS table so that dealers will get filtered based on RLS and a Dealer_Table with Fact sales for calculating rank of all dealers&lt;/P&gt;&lt;P&gt;Calculate Ranking for whole set of dealer using Dealer_Table and then some how lookup this ranks to the filtered Dealers from&amp;nbsp;Dealer_Table_RLS&amp;nbsp; table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 04 May 2021 15:19:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1822671#M38670</guid>
      <dc:creator>Senthil_Kumar</dc:creator>
      <dc:date>2021-05-04T15:19:18Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1974162#M43431</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I also have same scenario and couldnt achieve it and not sure if it is doable. Just trying to understand if you were able to achieve the expected result. If yes, could you please post the solution steps.&lt;/P&gt;</description>
      <pubDate>Thu, 22 Jul 2021 21:09:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1974162#M43431</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-22T21:09:11Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1975414#M43462</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&amp;nbsp;Yes, I was able to acheive this but the solution might affect your report performance if your dataset size is too huge. I have created 2 copies of main view, one I used for RLS filtering purpose and another for calculating rank to which RLS is not passed on and then I used TREATAS function to fetch the rank.&lt;/P&gt;&lt;P&gt;Please refer below update sample file.&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1gqeOrSuY7f2mhc7Kp7bQm9XsblThm51R/view?usp=sharing" target="_blank" rel="noopener nofollow noreferrer"&gt;Sample PBIX&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 09:48:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1975414#M43462</guid>
      <dc:creator>Senthil_Kumar</dc:creator>
      <dc:date>2021-07-23T09:48:17Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1975622#M43469</link>
      <description>&lt;P&gt;Hi Senthil,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can also compute the Ranking wihtin Power Query or Backend as this needs to be static.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 12:06:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1975622#M43469</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T12:06:33Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1975959#M43494</link>
      <description>&lt;P&gt;Hi Senthil,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the reply. I dont think i will be able to implement your approach since i have huge dataset almost 10M records and also my requirement is to create Rank based on measure value(these are again from different fact tables). I think its getting complicated.&lt;/P&gt;&lt;P&gt;Looking for any simple/straight forward solution.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 14:29:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1975959#M43494</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T14:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976032#M43500</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You are absolutely right. The only one way to do it so that it's dynamic is to make&amp;nbsp; a copy of the fact table and the dimensions which are being affected by RLS and then use TREATAS to move relationships from one sub-model to another. Yes, this will certainly work but your model... well, it'll at least double in size. If you can afford it, no problem. If the ranks were static, you could do with calculating them in PQ. But here it's no option &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt; So, you'll have to live with duplication of the fact table.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 14:56:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976032#M43500</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T14:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976039#M43501</link>
      <description>&lt;P&gt;OK, I've just had a thought. Since RLS conditions are after all a piece of DAX, that is logical expressions, you could craft an expression that will unhide all rows in very specific circumstances. For instance, you could write some logic that says to show all the rows if, say, some field in some table has been selected. That would then, I think, enable you to get the ranks without duplicating the fact table and dimensions. Think about it... The table that governs this behaviour could be hidden and you could place filters on the table using a measure(!!!), thus enabling the visibility of all the rows only for the calculation. How about this?&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 15:01:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976039#M43501</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T15:01:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976061#M43503</link>
      <description>&lt;P&gt;Creating a copy of the table and not applying RLS - could this give you a problem with security?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Otherwise why to apply RLS anyways - you could simple Filter.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 15:04:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976061#M43503</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T15:04:44Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976091#M43505</link>
      <description>&lt;P&gt;Thanks for suggestion.&lt;/P&gt;&lt;P&gt;RLS (Filter data for that particular vendor) will be applied first on entire dataset and then Rank logic will get executed. Just giving a thought that creating any expression/logic to unhide rows would work ?&lt;/P&gt;&lt;P&gt;I am doing research on it. This Rank is always been complicated in PowerBi with the way of requirement i have.&lt;/P&gt;&lt;P&gt;If anyone finds solution please suggest and will greatly appreciate your help!&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 15:14:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976091#M43505</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T15:14:40Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976305#M43508</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Again, as much as I know filtering is based on a logical DAX expression. Therefore you can make it dependent on anything you want in the model. Hence, you can put a filter on a hidden auxiliary table via code in a measure and then the measure will see everything in the model. THat's enough to calculate what you want.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 16:41:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976305#M43508</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T16:41:03Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976372#M43512</link>
      <description>&lt;P&gt;OK, if you go to the documentation, you'll find this:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Hence, your only option is to replicate a table or a set of tables. No other way, I'm afraid &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's the documentation:&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/power-bi/guidance/rls-guidance" target="_blank"&gt;Row-level security (RLS) guidance in Power BI Desktop - Power BI | Microsoft Docs&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 23 Jul 2021 17:23:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1976372#M43512</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-07-23T17:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Rank changes when RLS is applied</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1978481#M43588</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;I don't think it will pose any secutiry issue since we are just using the duplicated table for calculating the aggregated value.&lt;/P&gt;</description>
      <pubDate>Mon, 26 Jul 2021 06:37:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Rank-changes-when-RLS-is-applied/m-p/1978481#M43588</guid>
      <dc:creator>Senthil_Kumar</dc:creator>
      <dc:date>2021-07-26T06:37:20Z</dc:date>
    </item>
  </channel>
</rss>

