<?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: Conditional RLS DAX in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2638198#M77396</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 add one more row to user table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then RLS filter DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;User:
[UserEmail] = username() || [UserEmail] = "all"

TARIFF:
[ConsignorID] = "00000"
||
[ConsignorID] in values('User'[ConsignorID])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 Detele the relationship between these two tables and RLS Filter DAX:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;User:
[UserEmail] = username()

TARIFF:
[ConsignorID] = "00000"
||
[ConsignorID] in calculatetable(values('User'[ConsignorID]),filter('User',[UserEmail] = username()))
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pbix in the end you can refer.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Jul 2022 09:04:46 GMT</pubDate>
    <dc:creator>v-chenwuz-msft</dc:creator>
    <dc:date>2022-07-14T09:04:46Z</dc:date>
    <item>
      <title>Conditional RLS DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2631530#M76997</link>
      <description>&lt;DIV&gt;I read dozens of articles about RLS but it seems that none of them works for my case. I am sure that the solution should be simple, I just can’t find it somehow…&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I have a table ‘Tariff’ (with thousands of rows)&amp;nbsp;that shows tariffs,&amp;nbsp;and a table ‘User’&amp;nbsp;(hundreds of rows)&amp;nbsp;that shows which tariffs a user should see via his email.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;The trick is that ‘Tariff’ table contains 2 types of tariffs:&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;general&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tariffs (ConsignorId = «00000») and&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;personal&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;tariffs&amp;nbsp;(ConsignorId = «12345»; «67890»; etc.).&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;When a user logs in,&amp;nbsp;he&amp;nbsp;should see both general and his&amp;nbsp;personal&amp;nbsp;Tariffs.&lt;/DIV&gt;&lt;DIV&gt;For example:&lt;/DIV&gt;&lt;DIV&gt;user&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://e.mail.ru/compose/?mailto=mailto%3a1@gmail.com" target="_blank" rel="noopener noreferrer"&gt;1@gmail.com&lt;/A&gt;&amp;nbsp;should see TariffIds: A,&amp;nbsp;C,&amp;nbsp;B.&lt;/DIV&gt;&lt;DIV&gt;user&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://e.mail.ru/compose/?mailto=mailto%3a2@gmail.com" target="_blank" rel="noopener noreferrer"&gt;2@gmail.com&lt;/A&gt;&amp;nbsp;should see TariffIds: A,&amp;nbsp;C,&amp;nbsp;D.&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;So, I tried the following RLS rule, but it returns an error:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;img /&gt;&lt;img /&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;Please, help me out —&amp;nbsp;what should I do? How can I solve this?&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;I also&amp;nbsp;tried another way: I&amp;nbsp;split the table ‘Tariff’ into 2 tables —&amp;nbsp;general tariffs and personal tariffs, applied RLS on ‘personal tariffs’ table, then created a new table with UNION (‘general tariffs’, ‘personal tariffs’) but RLS did not work at all —&amp;nbsp;all the rows are displayed to each user.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;p.s. I will attach pbix file in a reply, if needed.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 11 Jul 2022 15:19:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2631530#M76997</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-11T15:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional RLS DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2631754#M77009</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;In your second DAX instead of writing false you can give a text , may be 1 or 0 and filter it out via FILTER&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Ritesh&lt;/P&gt;</description>
      <pubDate>Mon, 11 Jul 2022 17:07:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2631754#M77009</guid>
      <dc:creator>ribisht17</dc:creator>
      <dc:date>2022-07-11T17:07:11Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional RLS DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2638198#M77396</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Two ways.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;1 add one more row to user table.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then RLS filter DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;User:
[UserEmail] = username() || [UserEmail] = "all"

TARIFF:
[ConsignorID] = "00000"
||
[ConsignorID] in values('User'[ConsignorID])&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2 Detele the relationship between these two tables and RLS Filter DAX:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;User:
[UserEmail] = username()

TARIFF:
[ConsignorID] = "00000"
||
[ConsignorID] in calculatetable(values('User'[ConsignorID]),filter('User',[UserEmail] = username()))
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Result:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pbix in the end you can refer.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Jul 2022 09:04:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2638198#M77396</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-07-14T09:04:46Z</dc:date>
    </item>
    <item>
      <title>Re: Conditional RLS DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2641232#M77551</link>
      <description>&lt;P&gt;thanks a lot! it works!!! what a relief!&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 11:27:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/2641232#M77551</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-15T11:27:16Z</dc:date>
    </item>
  </channel>
</rss>

