<?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 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/1730597#M35809</link>
    <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an interesting problem that I've come some way towards solving but a complete solution eludes me, I was hoping that someone better than me would stumble upon this and find the solution laughably simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 tables, an RLS table and a Fact table like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RLS_table:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee_id&lt;/TD&gt;&lt;TD&gt;Manager_id&lt;/TD&gt;&lt;TD&gt;Branch_id&lt;/TD&gt;&lt;TD&gt;Job_desc&lt;/TD&gt;&lt;TD&gt;Path&lt;/TD&gt;&lt;TD&gt;RLS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Sales rep&lt;/TD&gt;&lt;TD&gt;2 | 1&lt;/TD&gt;&lt;TD&gt;1@email.com&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Branch Manager&lt;/TD&gt;&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B&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;327&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer B&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;407&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer A&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully created a path based RLS so that the manager (2) can see his/her own sales and any sales of the persons down the path function, but as is the case with customer (327) the manager cannot see this sale as the customer doesn't belong to any sales rep. I was wondering if anyone knows if there is a way to create a DAX so that if a sales happens outside of the path (i.e no Employee_id) then it goes to the branch manager of the branch in question, based on the job_desc column. It shouldn't say that the branch manager was responsible for the sale, it should be that it says "null" as employee_id for the sales total. My data set is far too big and volatile to manually add a dummy Employee_id and put that into the hierarchy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My current DAX:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PATHCONTAINS(RLS_table[Path],&lt;/P&gt;&lt;P&gt;MaxX(&lt;/P&gt;&lt;P&gt;Filter(&lt;/P&gt;&lt;P&gt;RLS_table,&lt;/P&gt;&lt;P&gt;[RLS]=USERPRINCIPALNAME()&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,RLS_table[Employee_id]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;</description>
    <pubDate>Thu, 18 Mar 2021 13:03:33 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-03-18T13:03:33Z</dc:date>
    <item>
      <title>Conditional RLS DAX</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1730597#M35809</link>
      <description>&lt;P&gt;Hello!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have an interesting problem that I've come some way towards solving but a complete solution eludes me, I was hoping that someone better than me would stumble upon this and find the solution laughably simple.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 tables, an RLS table and a Fact table like below:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;RLS_table:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Employee_id&lt;/TD&gt;&lt;TD&gt;Manager_id&lt;/TD&gt;&lt;TD&gt;Branch_id&lt;/TD&gt;&lt;TD&gt;Job_desc&lt;/TD&gt;&lt;TD&gt;Path&lt;/TD&gt;&lt;TD&gt;RLS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;P&gt;1&lt;/P&gt;&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Sales rep&lt;/TD&gt;&lt;TD&gt;2 | 1&lt;/TD&gt;&lt;TD&gt;1@email.com&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Branch Manager&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;2@email.com&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Sales rep&lt;/TD&gt;&lt;TD&gt;2 | 3&lt;/TD&gt;&lt;TD&gt;3@email.com&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Sales rep&lt;/TD&gt;&lt;TD&gt;2 | 4&lt;/TD&gt;&lt;TD&gt;4@email.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Fact_table:&lt;/STRONG&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Customer_id&lt;/TD&gt;&lt;TD&gt;Employee_id&lt;/TD&gt;&lt;TD&gt;Branch_id&lt;/TD&gt;&lt;TD&gt;Product&lt;/TD&gt;&lt;TD&gt;Volume&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;655&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer A&lt;/TD&gt;&lt;TD&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;1525&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer A&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;98&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer B&lt;/TD&gt;&lt;TD&gt;16&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;327&lt;/TD&gt;&lt;TD&gt;null&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer B&lt;/TD&gt;&lt;TD&gt;8&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;407&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;TD&gt;21&lt;/TD&gt;&lt;TD&gt;Computer A&lt;/TD&gt;&lt;TD&gt;11&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have successfully created a path based RLS so that the manager (2) can see his/her own sales and any sales of the persons down the path function, but as is the case with customer (327) the manager cannot see this sale as the customer doesn't belong to any sales rep. I was wondering if anyone knows if there is a way to create a DAX so that if a sales happens outside of the path (i.e no Employee_id) then it goes to the branch manager of the branch in question, based on the job_desc column. It shouldn't say that the branch manager was responsible for the sale, it should be that it says "null" as employee_id for the sales total. My data set is far too big and volatile to manually add a dummy Employee_id and put that into the hierarchy.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My current DAX:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;PATHCONTAINS(RLS_table[Path],&lt;/P&gt;&lt;P&gt;MaxX(&lt;/P&gt;&lt;P&gt;Filter(&lt;/P&gt;&lt;P&gt;RLS_table,&lt;/P&gt;&lt;P&gt;[RLS]=USERPRINCIPALNAME()&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;,RLS_table[Employee_id]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;================================================&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be greatly appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 13:03:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1730597#M35809</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-18T13:03:33Z</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/1731246#M35871</link>
      <description>&lt;P&gt;You can create a separate role that sees all "dangling"&amp;nbsp; data and assign your managers to that role.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 19:25:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1731246#M35871</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-03-18T19:25:29Z</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/1731350#M35880</link>
      <description>&lt;P&gt;Yes, but how :)? To work alongside the existing RLS path function&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 21:34:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1731350#M35880</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-18T21:34:48Z</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/1731383#M35884</link>
      <description>&lt;P&gt;As I said, create another role, and give it a rule that computes to TRUE() when the Employee_id in your fact table is BLANK(). Then add your managers to that role.&lt;/P&gt;</description>
      <pubDate>Thu, 18 Mar 2021 22:24:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1731383#M35884</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-03-18T22:24:48Z</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/1732188#M35903</link>
      <description>&lt;P&gt;This sounds really good, but I must be too stupid to see how I would do that. Do you mean that the role cannot be the job description? and that the role should be in the RLS table?&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 08:09:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1732188#M35903</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-19T08:09:45Z</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/1732666#M35927</link>
      <description>&lt;P&gt;Different RLS rules can be applied in different tables. As long as you take care not to make them conflicting or useless you will be fine.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 11:09:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1732666#M35927</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2021-03-19T11:09:28Z</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/1732893#M35936</link>
      <description>&lt;P&gt;Sounds lovely, do you think you could possibly show me what some DAX like that would look like? I really cannot understand how I would do it.&lt;/P&gt;</description>
      <pubDate>Fri, 19 Mar 2021 12:56:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Conditional-RLS-DAX/m-p/1732893#M35936</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-03-19T12:56:26Z</dc:date>
    </item>
  </channel>
</rss>

