<?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: How to get average gap through filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2394076#M62383</link>
    <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327190" data-lia-user-login="ade_kurniawan" class="lia-mention lia-mention-user"&gt;ade_kurniawan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need make a little bit change to your Gap score Measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Gap score =
VAR selectedYear =
    MAX ( Sheet1[Year] )
VAR CurrentScore =
    CALCULATE (
        [avg score],
        FILTER ( ALL ( Sheet1 ), Sheet1[Year] = selectedYear )
    )
VAR LastScore =
    CALCULATE (
        [avg score],
        FILTER ( ALL ( Sheet1 ), Sheet1[Year] = MAX ( Sheet1[Year] ) - 1 )
    )
RETURN
    CurrentScore - LastScore&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, the result should look like this.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post helps, then please consider&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;</description>
    <pubDate>Tue, 15 Mar 2022 06:07:50 GMT</pubDate>
    <dc:creator>v-cazheng-msft</dc:creator>
    <dc:date>2022-03-15T06:07:50Z</dc:date>
    <item>
      <title>How to get average gap through filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2387952#M61964</link>
      <description>&lt;P&gt;Dear friends,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to get gap from average score from all year data, but the data can't read because my slicer require single selection of year.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Score 2021 = 5.00&lt;BR /&gt;Score 2020 = 3.50&lt;BR /&gt;the gap score i want to show is 1.50, but if year select is 2021, 2020 data will not be calculated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;here is the pbix file :&amp;nbsp;&lt;A href="https://drive.google.com/file/d/10Gpy0UJmCDTovC8NJ25OtS5divb-QDmq/view?usp=sharing" target="_blank"&gt;https://drive.google.com/file/d/10Gpy0UJmCDTovC8NJ25OtS5divb-QDmq/view?usp=sharing&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Thanks for help&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 07:25:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2387952#M61964</guid>
      <dc:creator>ade_kurniawan</dc:creator>
      <dc:date>2022-03-11T07:25:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average gap through filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2388059#M61975</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327190" data-lia-user-login="ade_kurniawan" class="lia-mention lia-mention-user"&gt;ade_kurniawan&lt;/a&gt; , in such cases, it is best to have the date/year come from a separatetable. joined to your table&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Last year avg&amp;nbsp; =&lt;/P&gt;
&lt;P&gt;Calculate([Avg Score], filter(All(Date[Year]), Date[Year] = max(Date[Year])-1))&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;diff =&lt;/P&gt;
&lt;P&gt;[Avg Score] - [Last year avg]&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 11 Mar 2022 08:13:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2388059#M61975</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-03-11T08:13:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average gap through filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2394076#M62383</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="327190" data-lia-user-login="ade_kurniawan" class="lia-mention lia-mention-user"&gt;ade_kurniawan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need make a little bit change to your Gap score Measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Gap score =
VAR selectedYear =
    MAX ( Sheet1[Year] )
VAR CurrentScore =
    CALCULATE (
        [avg score],
        FILTER ( ALL ( Sheet1 ), Sheet1[Year] = selectedYear )
    )
VAR LastScore =
    CALCULATE (
        [avg score],
        FILTER ( ALL ( Sheet1 ), Sheet1[Year] = MAX ( Sheet1[Year] ) - 1 )
    )
RETURN
    CurrentScore - LastScore&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then, the result should look like this.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If there is any post helps, then please consider&lt;STRONG&gt; Accept it as the solution&lt;/STRONG&gt; to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let me know. Thanks a lot!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Community Support Team _ Caiyun&lt;/P&gt;</description>
      <pubDate>Tue, 15 Mar 2022 06:07:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2394076#M62383</guid>
      <dc:creator>v-cazheng-msft</dc:creator>
      <dc:date>2022-03-15T06:07:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average gap through filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2396770#M62565</link>
      <description>&lt;P&gt;thank you so much&lt;/P&gt;</description>
      <pubDate>Wed, 16 Mar 2022 03:55:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-get-average-gap-through-filter/m-p/2396770#M62565</guid>
      <dc:creator>ade_kurniawan</dc:creator>
      <dc:date>2022-03-16T03:55:43Z</dc:date>
    </item>
  </channel>
</rss>

