<?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 Filter rolling sum by status in current month in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2552018#M72246</link>
    <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table as shown below with many more materials, and a rolling sum measure for each material that usually works just fine.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;MATERIAL&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;STD_MARGIN&lt;/TD&gt;&lt;TD&gt;LEM_STATUS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.03.2022&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;28.02.2022&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.01.2022&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.12.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;30.11.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.10.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Red&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;30.09.2021&lt;/TD&gt;&lt;TD&gt;22,37&lt;/TD&gt;&lt;TD&gt;Red&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.08.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.07.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;30.06.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.05.2021&lt;/TD&gt;&lt;TD&gt;14,39&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;30.04.2021&lt;/TD&gt;&lt;TD&gt;-0,33&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I'd like to filter by the status of the current month --&amp;gt; only data with e.g. status =yellow in current month is displayed, but the rolling sum should still take all past 12 months into account, no matter what status they had.&lt;BR /&gt;&lt;BR /&gt;As of right now, I simply put the status in a slicer on my report page, but because the entire table is filtered by the status, the rolling sum value is incorrect.&lt;/P&gt;&lt;P&gt;For example for March and Status = Red --&amp;gt; 22,37 is displayed , however I'd want to have&amp;nbsp;&lt;STRONG&gt;22,37+14,39-0,33 =36,43.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For March and Status =yellow &lt;STRONG&gt;14,39-0,33=14,06 &lt;/STRONG&gt;is calculated, but I'd also want&amp;nbsp;22,37+14,39-0,33 =36,43 as calculation&lt;STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So what I'm looking for is not exactly a filter for the entire table, but rather for the current month status , without messing up the rolling sum calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated!&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2022 07:18:14 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-06-01T07:18:14Z</dc:date>
    <item>
      <title>Filter rolling sum by status in current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2552018#M72246</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a table as shown below with many more materials, and a rolling sum measure for each material that usually works just fine.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;MATERIAL&lt;/TD&gt;&lt;TD&gt;Date&lt;/TD&gt;&lt;TD&gt;STD_MARGIN&lt;/TD&gt;&lt;TD&gt;LEM_STATUS&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.03.2022&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;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t;30.06.2021&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;31.05.2021&lt;/TD&gt;&lt;TD&gt;14,39&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A311719&lt;/TD&gt;&lt;TD&gt;30.04.2021&lt;/TD&gt;&lt;TD&gt;-0,33&lt;/TD&gt;&lt;TD&gt;Yellow&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I'd like to filter by the status of the current month --&amp;gt; only data with e.g. status =yellow in current month is displayed, but the rolling sum should still take all past 12 months into account, no matter what status they had.&lt;BR /&gt;&lt;BR /&gt;As of right now, I simply put the status in a slicer on my report page, but because the entire table is filtered by the status, the rolling sum value is incorrect.&lt;/P&gt;&lt;P&gt;For example for March and Status = Red --&amp;gt; 22,37 is displayed , however I'd want to have&amp;nbsp;&lt;STRONG&gt;22,37+14,39-0,33 =36,43.&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;For March and Status =yellow &lt;STRONG&gt;14,39-0,33=14,06 &lt;/STRONG&gt;is calculated, but I'd also want&amp;nbsp;22,37+14,39-0,33 =36,43 as calculation&lt;STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;So what I'm looking for is not exactly a filter for the entire table, but rather for the current month status , without messing up the rolling sum calculation.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any help would be much appreciated!&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2022 07:18:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2552018#M72246</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-01T07:18:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filter rolling sum by status in current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2559899#M72796</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You need a separate date table to provide parameters for your formula.&lt;/P&gt;
&lt;P&gt;And please try this formula to do it.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="c"&gt;Measure =
VAR _end =
    MAX ( 'Date'[Date] )
VAR _start =
    DATE ( YEAR ( _end ) - 1, MONTH ( _end ), DAY ( _end ) )
RETURN
    CALCULATE (
        SUM ( 'Table'[STD_MARGIN] ),
        FILTER (
            ALLEXCEPT ( 'Table', 'Table'[MATERIAL] ),
            'Table'[Date] &amp;gt;= _start
                &amp;amp;&amp;amp; 'Table'[Date] &amp;lt;= _end
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Pbix in the end you can refer.&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Community Support Team _ chenwu zhu&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 02:26:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2559899#M72796</guid>
      <dc:creator>v-chenwuz-msft</dc:creator>
      <dc:date>2022-06-06T02:26:14Z</dc:date>
    </item>
    <item>
      <title>Re: Filter rolling sum by status in current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2560371#M72813</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="320777" data-lia-user-login="v-chenwuz-msft" class="lia-mention lia-mention-user"&gt;v-chenwuz-msft&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for yor response, that measure seems to work, the Status is now excluded from the calculation.&lt;BR /&gt;&lt;BR /&gt;The calculation is correct, but I would still need to filter by the status in the current month while still maintaining the correct sums over the last 12 months. So if i selected yellow, all last twelve months are calculated, independently of the status in each month, but only the current month=yellow Materials would show. As of right now, the status filter is excluded for the calculation, which is correct, but also for the filtering in the current month.&lt;BR /&gt;Would I need a seperate table with the status for this?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jun 2022 07:11:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2560371#M72813</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-06T07:11:13Z</dc:date>
    </item>
    <item>
      <title>Re: Filter rolling sum by status in current month</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2563433#M72989</link>
      <description>&lt;P&gt;Nevermind, I got it working, thanks for the help!!&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Jun 2022 09:11:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-rolling-sum-by-status-in-current-month/m-p/2563433#M72989</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-07T09:11:56Z</dc:date>
    </item>
  </channel>
</rss>

