<?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: Year Over Year Measure with Year Filter as Slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817632#M5481</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114168" data-lia-user-login="kentyler" class="lia-mention lia-mention-user"&gt;kentyler&lt;/a&gt;&amp;nbsp; thank you for responding but this doesn't give me Prior year when I select different years.&lt;/P&gt;</description>
    <pubDate>Mon, 14 Oct 2019 20:23:52 GMT</pubDate>
    <dc:creator>sqlguru448</dc:creator>
    <dc:date>2019-10-14T20:23:52Z</dc:date>
    <item>
      <title>Year Over Year Measure with Year Filter as Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/816677#M5429</link>
      <description>&lt;P&gt;Hello Guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to calculate Year over Year sales with Year as a slicer. I am able to achieve it when I have consecutive years but when I try to filter on year slicers with gap then it gives me incorrect result.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the data I want to achieve when Year slicer is selected as 2016,2018.&amp;nbsp; 1st table gives me correct output when no filter is applied on the Year slicer, but when the slicer is filtered on Year 2016 and 2018, I need to display the output in table 2. Please help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Current Year Sales&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Prior Year Sales&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2017&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;3500&lt;/TD&gt;&lt;TD&gt;2000&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Expected output for prior sales&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&lt;STRONG&gt;Year&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Current Year Sales&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD&gt;&lt;STRONG&gt;Prior Year Sales&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2016&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;TD&gt;0&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;2018&lt;/TD&gt;&lt;TD&gt;3500&lt;/TD&gt;&lt;TD&gt;1000&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&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>Thu, 17 Oct 2019 22:15:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/816677#M5429</guid>
      <dc:creator>sqlguru448</dc:creator>
      <dc:date>2019-10-17T22:15:21Z</dc:date>
    </item>
    <item>
      <title>Re: Year Over Year Measure with Year Filter as Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/816801#M5431</link>
      <description>&lt;P&gt;You need your filter to pick up the multiple months from the slicer. I found this solution in another post.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess if you replace your estimation measure&lt;/P&gt;&lt;PRE&gt;EstimateCurrentMonth = calculate(sum('Sales'[Estimate]);FILTER(ALL('Sales'[MonthNumber]);[MonthNumber] = 'MonthParameter'[MonthParValue]))&lt;/PRE&gt;&lt;P&gt;with this&lt;/P&gt;&lt;PRE&gt;EstimateCurrentMonth = 
var selectedMonths = Values('MonthParameter'[MonthParValue])
return
calculate(
	sum('Sales'[Estimate])
	;FILTER(
		ALL('Sales'[MonthNumber])
		;[MonthNumber] IN selectedMonths
	)
)&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.powerbi.com/t5/Desktop/Select-multiple-values-from-slicer-for-DAX-formula/td-p/500928" target="_blank"&gt;https://community.powerbi.com/t5/Desktop/Select-multiple-values-from-slicer-for-DAX-formula/td-p/500928&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 03:43:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/816801#M5431</guid>
      <dc:creator>kentyler</dc:creator>
      <dc:date>2019-10-14T03:43:30Z</dc:date>
    </item>
    <item>
      <title>Re: Year Over Year Measure with Year Filter as Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817632#M5481</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114168" data-lia-user-login="kentyler" class="lia-mention lia-mention-user"&gt;kentyler&lt;/a&gt;&amp;nbsp; thank you for responding but this doesn't give me Prior year when I select different years.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 20:23:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817632#M5481</guid>
      <dc:creator>sqlguru448</dc:creator>
      <dc:date>2019-10-14T20:23:52Z</dc:date>
    </item>
    <item>
      <title>Re: Year Over Year Measure with Year Filter as Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817633#M5482</link>
      <description>&lt;P&gt;I should have said, you need to pick up multiple years from the slicer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code examples show the pattern for doing that, but you have to change the table/column names&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 20:27:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817633#M5482</guid>
      <dc:creator>kentyler</dc:creator>
      <dc:date>2019-10-14T20:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Year Over Year Measure with Year Filter as Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817638#M5483</link>
      <description>&lt;P&gt;Yes, but this gives me only current month and current year, I don't get the prior year for the selected year 2016, 2018.&lt;/P&gt;&lt;BLOCKQUOTE&gt;&lt;HR /&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="114168" data-lia-user-login="kentyler" class="lia-mention lia-mention-user"&gt;kentyler&lt;/a&gt;&amp;nbsp;wrote:&lt;BR /&gt;&lt;P&gt;I should have said, you need to pick up multiple years from the slicer&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;the code examples show the pattern for doing that, but you have to change the table/column names&lt;/P&gt;&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Oct 2019 20:35:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/817638#M5483</guid>
      <dc:creator>sqlguru448</dc:creator>
      <dc:date>2019-10-14T20:35:28Z</dc:date>
    </item>
    <item>
      <title>Re: Year Over Year Measure with Year Filter as Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/821340#M5625</link>
      <description>&lt;P&gt;Tried to do multiple ways but if the year slicers is not selected consecutive years then the dateadd, sameperiodlast year functions are not working. Any help is really appreciated.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the DAX which I am working on.&lt;/P&gt;&lt;DIV class="gs"&gt;&lt;DIV class="btm"&gt;&lt;DIV class="gs"&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="ii gt"&gt;&lt;DIV class="a3s aXjCH "&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;1) Count YR Slicer = CALCULATE (&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;COUNTROWS ( FILTERS ( 'DDM D_DATE'[YEAR_NUMBER]))|&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;ALLSELECTED ( 'DDM D_DATE')&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;2) Max Yr Slicer values = CALCULATE(topn(1|VALUES('DDM D_DATE'[YEAR_NUMBER])|'DDM D_DATE'[YEAR_NUMBER]|DESC)|ALLSELECTED('DDM D_DATE'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;3) Min Yr Slicer values = CALCULATE(topn(1|VALUES('DDM D_DATE'[YEAR_NUMBER]))|ALLSELECTED('DDM D_DATE'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;4) Custom Paid Amount LY = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var countdiff_2 =&amp;nbsp; If( [Count YR Slicer] = 2 &amp;amp;&amp;amp; [Max Yr Slicer values] - [Min Yr Slicer values] = 2|1|0) &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var MaxYrSlicer = CALCULATE(topn(1|VALUES('DDM D_DATE'[YEAR_NUMBER])|'DDM D_DATE'[YEAR_NUMBER]|DESC)|ALLSELECTED('DDM D_DATE'))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&amp;nbsp; &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;If(countdiff_2 &amp;lt;&amp;gt; 1| CALCULATE([Total Paid Amount]|SAMEPERIODLASTYEAR('DDM D_DATE'[CALENDAR_DATE]))|&amp;nbsp; CALCULATE([Total Paid Amount]|&amp;nbsp; DATEADD('DDM D_DATE'[CALENDAR_DATE]|-2|YEAR)))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV class="ii gt"&gt;&lt;DIV class="a3s aXjCH "&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 17 Oct 2019 22:30:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Year-Over-Year-Measure-with-Year-Filter-as-Slicer/m-p/821340#M5625</guid>
      <dc:creator>sqlguru448</dc:creator>
      <dc:date>2019-10-17T22:30:37Z</dc:date>
    </item>
  </channel>
</rss>

