<?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: YTD with year month slicer combined with 12 months back functionality in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2603635#M75337</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In my understanding, when you select a value in the Year-Month slicer, you want to get the sum sales of date in the selected year, here's my solution.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;KPI YTD =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER (
        ALL ( 'Table' ),
        YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2022 09:29:19 GMT</pubDate>
    <dc:creator>v-yanjiang-msft</dc:creator>
    <dc:date>2022-06-27T09:29:19Z</dc:date>
    <item>
      <title>YTD with year month slicer combined with 12 months back functionality</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2597394#M74986</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need your help again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've implemented one of Alberto's awesome calculation items to get various measures to show the 12 months back values in charts.&amp;nbsp;&lt;A href="https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/" target="_blank" rel="noopener"&gt;https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To have this data I had to change my year + month slicer to the combo YYYYMM slicer.&lt;BR /&gt;&lt;BR /&gt;All KPI's and charts are working fine except the YTD KPI card.&lt;BR /&gt;The KPI YTD card is currently showing the sum of all years in the source, and I can't get it to show the sumof months for the selected year in the year/month (YYYYMM) slicer.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I tried a bunch of DAX tweaking, to remove one filter context and push a different one but nothing is working. Can anyone help with this? I've referred to one of the member's code from the community but didn't work in my report.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A title="https://community.powerbi.com/t5/dax-commands-and-tips/ytd-with-selectedvalue-of-year-month-slicer/m-p/1597994" href="https://community.powerbi.com/t5/DAX-Commands-and-Tips/YTD-with-SelectedValue-of-Year-Month-Slicer/m-p/1597994" target="_blank" rel="noopener noreferrer"&gt;https://community.powerbi.com/t5/DAX-Commands-and-Tips/YTD-with-SelectedValue-of-Year-Month-Slicer/m-p/1597994&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Value ROS YTD =&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// Var ROSYTD =&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// TOTALYTD(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// ValueROS,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// dim_date[CalendarDate])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;//Var ROSYTD_filter =&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;//ROSYTD,&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(factsaleout),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;//left(factsaleout[dimdatesk],6) &amp;gt;= LEFT(SELECTEDVALUE(dim_date[YearMonth]),4)&amp;amp;"01" &amp;amp;&amp;amp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;// left(factsaleout[dimdatesk],6) &amp;lt;= SELECTEDVALUE(dim_date[YearMonth])))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Var&lt;/SPAN&gt; &lt;SPAN&gt;ROSYTD1&lt;/SPAN&gt;&lt;SPAN&gt; =&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;ValueROS&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DATESYTD&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;dim_date[CalendarDate]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;BR /&gt;&lt;DIV&gt;&lt;SPAN&gt;Return&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ROSYTD1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 23 Jun 2022 10:20:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2597394#M74986</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-23T10:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: YTD with year month slicer combined with 12 months back functionality</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2603635#M75337</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, I create a sample.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;In my understanding, when you select a value in the Year-Month slicer, you want to get the sum sales of date in the selected year, here's my solution.&lt;/P&gt;
&lt;P&gt;Create a measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;KPI YTD =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    FILTER (
        ALL ( 'Table' ),
        YEAR ( 'Table'[Date] ) = YEAR ( MAX ( 'Table'[Date] ) )
    )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2022 09:29:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2603635#M75337</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-06-27T09:29:19Z</dc:date>
    </item>
    <item>
      <title>Re: YTD with year month slicer combined with 12 months back functionality</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2608640#M75585</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;SPAN&gt;v-kalyj-msft,&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Not quite what I need &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; since this shows the YTD for the last month 12-2021 or 06-2022. I need when I select 03-2022 to show 03-2022 YTD, now it shows 06-2022 YTD when 03-2022 is selected.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 29 Jun 2022 08:01:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2608640#M75585</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-06-29T08:01:24Z</dc:date>
    </item>
    <item>
      <title>Re: YTD with year month slicer combined with 12 months back functionality</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2618529#M76188</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I misunderstood it. I modify the formula like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;KPI YTD =
CALCULATE (
    SUM ( 'Table'[Sales] ),
    DATESYTD ( 'Table'[Date] ),
    REMOVEFILTERS ( 'Table'[Year-Month] )
)
&lt;/LI-CODE&gt;
&lt;P&gt;Get the correct result.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;I attach my sample below for reference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _ kalyj&lt;/P&gt;
&lt;P&gt;If this post&lt;SPAN&gt;&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;helps,&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;then please consider&amp;nbsp;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&amp;nbsp;&lt;/STRONG&gt;&lt;/EM&gt;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 05 Jul 2022 02:52:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2618529#M76188</guid>
      <dc:creator>v-yanjiang-msft</dc:creator>
      <dc:date>2022-07-05T02:52:27Z</dc:date>
    </item>
    <item>
      <title>Re: YTD with year month slicer combined with 12 months back functionality</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2641442#M77564</link>
      <description>&lt;P&gt;Yes this is it! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thank you so much, I made a measure that worked but was way to long, this one works like a charm &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 15 Jul 2022 13:13:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/YTD-with-year-month-slicer-combined-with-12-months-back/m-p/2641442#M77564</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-07-15T13:13:54Z</dc:date>
    </item>
  </channel>
</rss>

