<?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: Different measure depending on filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2821349#M89570</link>
    <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13112" data-lia-user-login="jeffshieldsdev" class="lia-mention lia-mention-user"&gt;jeffshieldsdev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to ignore the&amp;nbsp;&lt;SPAN&gt;'Geo Hierarchy'[State] filter on your visual , you need to use ALL() function , like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Unique Visits (measure) = CALCULATE(
    IF(
        ISFILTERED('Geo Hierarchy'[State/Prov]),
        SUM('Unique Visits by State'[Unique Visits by State]),
        SUM('Unique Visits by Country'[Unique Visits by Country])
    ),ALL('Geo Hierarchy'[State/Prov])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also for your question, you can provide us with the &lt;STRONG&gt;sample output data&lt;/STRONG&gt; you want so that we can better help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Oct 2022 01:56:55 GMT</pubDate>
    <dc:creator>v-yueyunzh-msft</dc:creator>
    <dc:date>2022-10-06T01:56:55Z</dc:date>
    <item>
      <title>Different measure depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2820744#M89563</link>
      <description>&lt;P&gt;I have a mixed grain problem.&lt;/P&gt;&lt;P&gt;In my model I have two fact tables: Unique Visits by Country, and Unique Visits by State.&lt;/P&gt;&lt;P&gt;These are both aggregated counts. Unique Visits by State is always accurate in visuals, but I can't merely SUM Unique Visits by State to get Unique Visits by Country because it results in double-counting--if there are two States with two Unique Visits, Unique Visits by the Country should be two--not four.&lt;/P&gt;&lt;P&gt;So I need to seperate tables in my model.&lt;/P&gt;&lt;P&gt;My challenge is in getting the right value to show in a hierarchial Matrix visual. This measure seems to work:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Unique Visits (measure) = CALCULATE(
    IF(
        ISFILTERED('Geo Hierarchy'[State]),
        SUM('Unique Visits by State'[Unique Visits]),
        SUM('Unique Visits by Country'[Unique Visits])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But if I have a Report-level or Page-level filters on 'Geo Hierarchy'[State] than the Unique Visits by State will show in the Country-level of the matrix.&lt;/P&gt;&lt;P&gt;Is there a better approach, or how can I get my measure to ignore Report- or Page-level filters? Thank you.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&amp;nbsp;&lt;A href="https://drive.google.com/file/d/1qIOuLRU-iwcs0X2Oe8_V2qjb6ySYn94l/view?usp=sharing" target="_self"&gt;Mixed Grain Aggregation Problem_2022-10-05_1535.pbix&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 05 Oct 2022 20:55:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2820744#M89563</guid>
      <dc:creator>jeffshieldsdev</dc:creator>
      <dc:date>2022-10-05T20:55:36Z</dc:date>
    </item>
    <item>
      <title>Re: Different measure depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2821349#M89570</link>
      <description>&lt;P&gt;Hi ,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="13112" data-lia-user-login="jeffshieldsdev" class="lia-mention lia-mention-user"&gt;jeffshieldsdev&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you want to ignore the&amp;nbsp;&lt;SPAN&gt;'Geo Hierarchy'[State] filter on your visual , you need to use ALL() function , like this:&lt;/SPAN&gt;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Unique Visits (measure) = CALCULATE(
    IF(
        ISFILTERED('Geo Hierarchy'[State/Prov]),
        SUM('Unique Visits by State'[Unique Visits by State]),
        SUM('Unique Visits by Country'[Unique Visits by Country])
    ),ALL('Geo Hierarchy'[State/Prov])
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Also for your question, you can provide us with the &lt;STRONG&gt;sample output data&lt;/STRONG&gt; you want so that we can better help you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Aniya Zhang&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt; it as the solution&lt;/EM&gt;&amp;nbsp;to help the other members find it more quickly&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Oct 2022 01:56:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2821349#M89570</guid>
      <dc:creator>v-yueyunzh-msft</dc:creator>
      <dc:date>2022-10-06T01:56:55Z</dc:date>
    </item>
    <item>
      <title>Re: Different measure depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2826416#M89873</link>
      <description>&lt;P&gt;Thanks for the reply.&lt;/P&gt;&lt;P&gt;I shared a .pbix above.&lt;/P&gt;&lt;P&gt;The green column in my screenshot is what I should be getting. The measure does work, but when there is a Page- or Report-level filter, it does not because ISFILTERED() returns TRUE when there's a Page-/Report-level filter.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 16:58:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2826416#M89873</guid>
      <dc:creator>jeffshieldsdev</dc:creator>
      <dc:date>2022-10-07T16:58:47Z</dc:date>
    </item>
    <item>
      <title>Re: Different measure depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2826457#M89874</link>
      <description>&lt;P&gt;Maybe HASONEFILTER() is a better choice here. Only one filter will be present the lower-granularity rows of the Matrix visual, so this works:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Unique Visits (measure)3 = CALCULATE(
    IF(
        HASONEFILTER('Geo Hierarchy'[State/Prov]),
        SUM('Unique Visits by State'[Unique Visits by State]),
        SUM('Unique Visits by Country'[Unique Visits by Country])
    )
)&lt;/LI-CODE&gt;&lt;P&gt;EDIT: This doesn't work in all situations either. Basically when at a State level in the hierarchy, I want to pull the value from the State table--otherwise I want to pull from the Country table.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Oct 2022 19:45:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2826457#M89874</guid>
      <dc:creator>jeffshieldsdev</dc:creator>
      <dc:date>2022-10-07T19:45:39Z</dc:date>
    </item>
    <item>
      <title>Re: Different measure depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2827302#M89922</link>
      <description>&lt;P&gt;I found this solution from Phil Seamark at &lt;A href="https://dax.tips/" target="_self"&gt;DAX.tips&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&lt;A href="https://dax.tips/2019/10/18/creative-aggs-part-i-introduction/" target="_blank"&gt;Creative Aggs Part I : Introduction - Phil Seamark on DAX&lt;/A&gt;&lt;/P&gt;&lt;P&gt;It uses INSCOPE() so I'm going to go with that.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Unique Visits (measure) ISINSCOPE = CALCULATE(
    IF(
        ISINSCOPE('Geo Hierarchy'[State/Prov]),
        SUM('Unique Visits by State'[Unique Visits by State]),
        SUM('Unique Visits by Country'[Unique Visits by Country])
    )
)&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 08 Oct 2022 14:00:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Different-measure-depending-on-filters/m-p/2827302#M89922</guid>
      <dc:creator>jeffshieldsdev</dc:creator>
      <dc:date>2022-10-08T14:00:08Z</dc:date>
    </item>
  </channel>
</rss>

