<?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 show previous month when selected month slicer. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3908152#M152237</link>
    <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To adjust your cumulative measure to show the value for January correctly, you need to modify the filter condition to include the specific month. You can achieve this by adding an additional condition that checks if the month of the date is less than or equal to the selected month. Here's how you can modify your measure:&lt;/P&gt;&lt;P&gt;ExpenseYTD =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Expenses[Expense]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Date'),&lt;BR /&gt;'Date'[Date] &amp;lt;= MAX('Date'[Date]) &amp;amp;&amp;amp;&lt;BR /&gt;'Date'[FiscalYear] = MAX('Date'[FiscalYear]) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH('Date'[Date]) = MONTH(MAX('Date'[Date]))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 10 May 2024 09:48:21 GMT</pubDate>
    <dc:creator>johnbasha33</dc:creator>
    <dc:date>2024-05-10T09:48:21Z</dc:date>
    <item>
      <title>How to show previous month when selected month slicer.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3907831#M152230</link>
      <description>&lt;P&gt;I have cumulative measure like this. It cumulative from Oct-Sep in the year&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I run in to problem when I want select Jan. I want to show value from Out-Jan cumulative on graph&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;The result should be like picture below&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;STRONG&gt;This is my cumulative measure.&lt;/STRONG&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ExpenseYTD =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Expenses&lt;/SPAN&gt;&lt;SPAN&gt;[Expense]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;ALL&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;'Date'&lt;/SPAN&gt;&lt;SPAN&gt;[Date]&lt;/SPAN&gt;&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p;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 10 May 2024 10:55:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3907831#M152230</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-10T10:55:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to show previous month when selected month slicer.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3908152#M152237</link>
      <description>&lt;P&gt;Anonymous&lt;/LI-USER&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To adjust your cumulative measure to show the value for January correctly, you need to modify the filter condition to include the specific month. You can achieve this by adding an additional condition that checks if the month of the date is less than or equal to the selected month. Here's how you can modify your measure:&lt;/P&gt;&lt;P&gt;ExpenseYTD =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM(Expenses[Expense]),&lt;BR /&gt;FILTER(&lt;BR /&gt;ALL('Date'),&lt;BR /&gt;'Date'[Date] &amp;lt;= MAX('Date'[Date]) &amp;amp;&amp;amp;&lt;BR /&gt;'Date'[FiscalYear] = MAX('Date'[FiscalYear]) &amp;amp;&amp;amp;&lt;BR /&gt;MONTH('Date'[Date]) = MONTH(MAX('Date'[Date]))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;&lt;BR /&gt;Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 09:48:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3908152#M152237</guid>
      <dc:creator>johnbasha33</dc:creator>
      <dc:date>2024-05-10T09:48:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to show previous month when selected month slicer.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3908448#M152240</link>
      <description>&lt;P&gt;Sorry If I make you misunderstand. My measure done the cumulative correctly.&lt;/P&gt;&lt;P&gt;The result should like pictuer below if I select only Jan.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 10:54:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3908448#M152240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-10T10:54:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to show previous month when selected month slicer.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3909582#M152266</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;If your slicer uses the same month as the line chart, pls first change the slicer's month to another month field of other table to avoid the &lt;STRONG&gt;Auto-Exist&lt;/STRONG&gt; mechanism.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can copy the date table and name it &lt;STRONG&gt;Date2&lt;/STRONG&gt;, without establishing any relationships with other tables. Then,&amp;nbsp;Use the &lt;STRONG&gt;month of Date2&lt;/STRONG&gt; as the field for the slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Additionally, based on the line chart you provided, the month field should have a sorting reference field, otherwise the months on the line chart should be out of order.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So, we can modify the measure as follows:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;ExpenseYTD-Modify =
VAR SelectedSlicerMonthIndex = MAX('Date2'[Month Index])
VAR CurLineChartMonthIndex = MAX('Date'[Month Index])
RETURN
IF(CurLineChartMonthIndex &amp;lt;= SelectedSlicerMonthIndex,
    CALCULATE(
       SUM(Expenses[Expense]),
        FILTER(
            ALL('Date'),
            'Date'[Date] &amp;lt;= MAX('Date'[Date]) &amp;amp;&amp;amp;
            'Date'[FiscalYear] = MAX('Date'[FiscalYear]) &amp;amp;&amp;amp;
            IF(SUM('Expenses'[Expense]) = BLANK(), 0, 1) = 1
        )
    )
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Did I answer your question? If yes, pls mark my post as a solution and a&lt;SPAN&gt;ppreciate your Kudos&lt;/SPAN&gt;&amp;nbsp;!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you~&lt;/P&gt;</description>
      <pubDate>Fri, 10 May 2024 16:53:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3909582#M152266</guid>
      <dc:creator>xifeng_L</dc:creator>
      <dc:date>2024-05-10T16:53:56Z</dc:date>
    </item>
    <item>
      <title>Re: How to show previous month when selected month slicer.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3910675#M152306</link>
      <description>&lt;P&gt;Thank you so much!!! Your solution is working.&lt;/P&gt;</description>
      <pubDate>Sat, 11 May 2024 12:37:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-show-previous-month-when-selected-month-slicer/m-p/3910675#M152306</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-05-11T12:37:28Z</dc:date>
    </item>
  </channel>
</rss>

