<?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 Default filter -- based on max/min value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2216539#M52487</link>
    <description>&lt;P&gt;I have RLS implemented&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is for a user with all Access , I do not want to illustrate a graph with all options , too busy&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Solution is to idenify the max ID assocaited with the Filter , have a generic name "Default" ; regardless of the options avaialble , it will always illustrate Default option based on what the user has access to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having issue with DAX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max = &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;HospIDMax&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Max&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital[HospitalID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital[Hospital]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;"National"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital&lt;/SPAN&gt;&lt;SPAN&gt;[HospitalID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;HospIDMax&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"Default"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DimHospital&lt;/SPAN&gt;&lt;SPAN&gt;[Hospital]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 01 Dec 2021 17:01:43 GMT</pubDate>
    <dc:creator>carlol</dc:creator>
    <dc:date>2021-12-01T17:01:43Z</dc:date>
    <item>
      <title>Default filter -- based on max/min value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2216539#M52487</link>
      <description>&lt;P&gt;I have RLS implemented&amp;nbsp;&lt;/P&gt;&lt;P&gt;The issue is for a user with all Access , I do not want to illustrate a graph with all options , too busy&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My Solution is to idenify the max ID assocaited with the Filter , have a generic name "Default" ; regardless of the options avaialble , it will always illustrate Default option based on what the user has access to&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Having issue with DAX&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Something like this&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max = &lt;/SPAN&gt;&lt;SPAN&gt;VAR&lt;/SPAN&gt; &lt;SPAN&gt;HospIDMax&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;Calculate&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Max&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital[HospitalID]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital[Hospital]&lt;/SPAN&gt;&lt;SPAN&gt;&amp;lt;&amp;gt;&lt;/SPAN&gt;&lt;SPAN&gt;"National"&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;IF&lt;/SPAN&gt;&lt;SPAN&gt;(&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;DimHospital&lt;/SPAN&gt;&lt;SPAN&gt;[HospitalID]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;HospIDMax&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;"Default"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DimHospital&lt;/SPAN&gt;&lt;SPAN&gt;[Hospital]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 01 Dec 2021 17:01:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2216539#M52487</guid>
      <dc:creator>carlol</dc:creator>
      <dc:date>2021-12-01T17:01:43Z</dc:date>
    </item>
    <item>
      <title>Re: Default filter -- based on max/min value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2218098#M52546</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="173272" data-lia-user-login="carlol" class="lia-mention lia-mention-user"&gt;carlol&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Try this:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Max =
VAR HospIDMax =
    CALCULATE(
        MAX( DimHospital[HospitalID] ),
        FILTER( DimHospital, DimHospital[Hospital] &amp;lt;&amp;gt; "National" )
    )
VAR _M =
    MAX( DimHospital[HospitalID] )
RETURN
    IF( _M = HospIDMax, "Default", _M )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;SPAN&gt;helps&lt;/SPAN&gt;&lt;/STRONG&gt;, please consider&amp;nbsp;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;accepting&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;it as the solution&lt;/SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;BR /&gt;&lt;STRONG&gt;&lt;SPAN&gt;Appreciate your Kudos!!&lt;BR /&gt;&lt;STRONG&gt;LinkedIn:&amp;nbsp;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;SPAN&gt;&lt;A href="https://www.linkedin.com/in/vahid-dm/" target="_blank"&gt;www.linkedin.com/in/vahid-dm/&lt;/A&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;STRONG&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Dec 2021 12:13:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2218098#M52546</guid>
      <dc:creator>VahidDM</dc:creator>
      <dc:date>2021-12-02T12:13:52Z</dc:date>
    </item>
    <item>
      <title>Re: Default filter -- based on max/min value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2224548#M52918</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="173272" data-lia-user-login="carlol" class="lia-mention lia-mention-user"&gt;carlol&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;Could you tell me if &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="315278" data-lia-user-login="VahidDM" class="lia-mention lia-mention-user"&gt;VahidDM&lt;/a&gt;&amp;nbsp;'s post helps you? If it is, kindly &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt; &lt;/STRONG&gt;to make the thread closed. More people will benefit from it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Eyelyn Qin&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 06:28:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2224548#M52918</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-07T06:28:52Z</dc:date>
    </item>
    <item>
      <title>Re: Default filter -- based on max/min value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2227548#M53088</link>
      <description>&lt;P&gt;Thanks will give it a try and let you know how I get on&lt;/P&gt;</description>
      <pubDate>Wed, 08 Dec 2021 10:49:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Default-filter-based-on-max-min-value/m-p/2227548#M53088</guid>
      <dc:creator>carlol</dc:creator>
      <dc:date>2021-12-08T10:49:51Z</dc:date>
    </item>
  </channel>
</rss>

