<?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: ALL Filter is causing column subtotal value to be incorrect in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1892884#M40777</link>
    <description>&lt;P&gt;There was a missing comma after PeriodsBack. I've corrected it above. Apart from this the formula works correctly when the model is set up the way I think it is. Since you have not shown the model... I had to imagine what it is. I can easily demonstrate that it does what it should.&lt;/P&gt;</description>
    <pubDate>Thu, 10 Jun 2021 08:43:35 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-06-10T08:43:35Z</dc:date>
    <item>
      <title>ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1887869#M40654</link>
      <description>&lt;P&gt;The following formula is pulling the correct value in the matrix but the column subtotal of the row is incorrect and only totaling the last value in the matrix row.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;CALCULATE([Gross_Amount], FILTER(ALL(Periods), Periods[Index] = MAX(Periods[Index])-13))&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The intentioion of the formula is have the current year period column headings ignored and then pull the previous year figures for the same period of time. IE P05 2021 ignored, data for P05 2020 pulled instead.&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 11:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1887869#M40654</guid>
      <dc:creator>powerbi-help1</dc:creator>
      <dc:date>2021-06-08T11:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1888110#M40667</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Measure] =
var VisiblePeriods = DISTINCT( Periods[Index] )
var PeriodsBack = 
    FILTER(
        ALL( Periods[Index] ),
        ( Periods[Index] + 13 ) in VisiblePeriods
    )
var Result = 
    CALCULATE(
        [Gross_Amount],
        PeriodsBack,
        // Depending on what you really want
        // your measure to do, you can include
        // this line below or exclude it:
        ALL( Periods )
    )
return
    Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:43:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1888110#M40667</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-10T08:43:54Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1889078#M40692</link>
      <description>&lt;P&gt;Thank you for the response. The formula did not work and returned a 0 value (after being edited to not have an error).&lt;/P&gt;&lt;P&gt;When I tried to use the result portion above as written and removed the //lines keeping the ALL (Periods) there was an error:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;"The syntax for 'ALL' is incorrect. (DAX(var VisiblePeriods = DISTINCT( Periods[Index] )var PeriodsBack = FILTER( ALL( Periods[Index] ), ( Periods[Index] + 13 ) in VisiblePeriods )var Result = CALCULATE( [Gross_Amount], PeriodsBack ALL( Periods ) )return Result))."&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Formula written as that produced error:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var VisiblePeriods = DISTINCT( Periods[Index] )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var PeriodsBack = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;FILTER(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL( Periods[Index] ),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;( Periods[Index] + 13 ) in VisiblePeriods&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var Result = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;[Gross_Amount],&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;PeriodsBack&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALL( Periods )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Result&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Essentially I need the matrix to ignore the Year-Period columns and index from the CY period (ie P05 2021) to PY (P05 2020, hence the -13 on the index formula). My original formula I sent pulls each period but does not subtotal properly.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 08 Jun 2021 21:43:34 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1889078#M40692</guid>
      <dc:creator>powerbi-help1</dc:creator>
      <dc:date>2021-06-08T21:43:34Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1891791#M40749</link>
      <description>&lt;P&gt;I have made some additional changes to the formula, please see below.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;var VisiblePeriods = DISTINCT( Periods[Index] )&lt;BR /&gt;var PeriodsBack =&lt;BR /&gt;FILTER(ALL(Periods),MAX(Periods[Index])-13 in VisiblePeriods)&lt;BR /&gt;var Result =&lt;BR /&gt;CALCULATE([Gross_Amount],PeriodsBack)&lt;BR /&gt;return&lt;BR /&gt;Result&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This returns a zero value but no error, any advice on how to solve?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Jun 2021 21:15:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1891791#M40749</guid>
      <dc:creator>powerbi-help1</dc:creator>
      <dc:date>2021-06-09T21:15:45Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1892884#M40777</link>
      <description>&lt;P&gt;There was a missing comma after PeriodsBack. I've corrected it above. Apart from this the formula works correctly when the model is set up the way I think it is. Since you have not shown the model... I had to imagine what it is. I can easily demonstrate that it does what it should.&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 08:43:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1892884#M40777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-10T08:43:35Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1894397#M40825</link>
      <description>&lt;P&gt;Thank you, yes i was able utilize the formula to to produce the results as needed.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 21:15:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1894397#M40825</guid>
      <dc:creator>powerbi-help1</dc:creator>
      <dc:date>2021-06-10T21:15:44Z</dc:date>
    </item>
    <item>
      <title>Re: ALL Filter is causing column subtotal value to be incorrect</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1894415#M40826</link>
      <description>&lt;P&gt;Great &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Jun 2021 21:27:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/ALL-Filter-is-causing-column-subtotal-value-to-be-incorrect/m-p/1894415#M40826</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-06-10T21:27:57Z</dc:date>
    </item>
  </channel>
</rss>

