<?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 Static RLS using IF logic with two tables in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3026782#M103249</link>
    <description>&lt;P&gt;Hello community! I cannot find much material out there on DAX expressions for RLS. Here is my dilema. I am trying to create a static security view based on sales territories. However, no territories are assigned to Source "A". When I create the role for the territory, people cannot see Source A because there is no territory tied to it. Here is the relationship:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried creating this expression, but it is giving me a syntax error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF(OR(Revenue Source[Source] = "B", Revenue Source[Source] = "C"),
    FILTER(ALL(Territories), Territories[Territory] = "T23"),
    ALL(Territories)
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Spelling is correct.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Essentially, if they are viewing Source B and C, it needs to be filtered to T23. If they are viewing source A, they need to see all the data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, I have to select which table to put this code into, and I am not sure if that matter or not. Do I put it into Revenue Source or do I put it into Territories?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe~&lt;/P&gt;</description>
    <pubDate>Tue, 17 Jan 2023 19:17:59 GMT</pubDate>
    <dc:creator>jwin2424</dc:creator>
    <dc:date>2023-01-17T19:17:59Z</dc:date>
    <item>
      <title>Static RLS using IF logic with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3026782#M103249</link>
      <description>&lt;P&gt;Hello community! I cannot find much material out there on DAX expressions for RLS. Here is my dilema. I am trying to create a static security view based on sales territories. However, no territories are assigned to Source "A". When I create the role for the territory, people cannot see Source A because there is no territory tied to it. Here is the relationship:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried creating this expression, but it is giving me a syntax error.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;IF(OR(Revenue Source[Source] = "B", Revenue Source[Source] = "C"),
    FILTER(ALL(Territories), Territories[Territory] = "T23"),
    ALL(Territories)
)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Spelling is correct.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Essentially, if they are viewing Source B and C, it needs to be filtered to T23. If they are viewing source A, they need to see all the data.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Also, I have to select which table to put this code into, and I am not sure if that matter or not. Do I put it into Revenue Source or do I put it into Territories?&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thanks in advance!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe~&lt;/P&gt;</description>
      <pubDate>Tue, 17 Jan 2023 19:17:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3026782#M103249</guid>
      <dc:creator>jwin2424</dc:creator>
      <dc:date>2023-01-17T19:17:59Z</dc:date>
    </item>
    <item>
      <title>Re: Static RLS using IF logic with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3027805#M103320</link>
      <description>&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343802" data-lia-user-login="jwin2424" class="lia-mention lia-mention-user"&gt;jwin2424&lt;/a&gt;,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;I'd like to suggest you add a custom table to bind username with sources, then you can use current username to lookup correspond source and use it as condition to filter table records.&lt;/FONT&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;IF (
    LOOKUPVALUE ( 'Table'[Source], 'Table'[email], USERNAME () ) IN { "B", "C" },
    Territories[Territory] = "T23",
    Territories[Territory] = TRUE ()
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Regards,&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="tahoma,arial,helvetica,sans-serif"&gt;Xiaoxin Sheng&lt;/FONT&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 07:06:22 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3027805#M103320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-18T07:06:22Z</dc:date>
    </item>
    <item>
      <title>Re: Static RLS using IF logic with two tables</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3029451#M103466</link>
      <description>&lt;P&gt;Thank you for the quick reply! I tried a few things last night, but I figured out where I was going wrong. I was filtering the role this way:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;I was filtering on two tables, and it was giving me the filter ONLY for the revenue source.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I created two roles - one for territory and one for revenue source. Then I gave both roles to the employee and they can see either/or.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;The formula you provided I believe is for dynamic RLS, and I want to do static RLS.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jan 2023 18:52:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Static-RLS-using-IF-logic-with-two-tables/m-p/3029451#M103466</guid>
      <dc:creator>jwin2424</dc:creator>
      <dc:date>2023-01-18T18:52:50Z</dc:date>
    </item>
  </channel>
</rss>

