<?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 compare the values based on the user's selected year Vs previous year. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4301401#M170804</link>
    <description>&lt;P&gt;&lt;FONT&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry to bother you.&lt;/P&gt;
&lt;P&gt;I would like ask if my previous reply has helped you resolved the problem? If so, please consider accepting the previous reply as a solution.&amp;nbsp;This will make it easier for other users experiencing the same problem to find a solution.&lt;/P&gt;
&lt;P&gt;If you have any other questions, please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jarvis Tang&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Nov 2024 06:31:23 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-11-26T06:31:23Z</dc:date>
    <item>
      <title>How to compare the values based on the user's selected year Vs previous year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4291400#M170297</link>
      <description>&lt;P&gt;Hello All....&lt;BR /&gt;I have a date table and sales tables; in the sales table, I have 3 columns: WL, date, and amount.&lt;BR /&gt;&lt;BR /&gt;Requirement:&lt;BR /&gt;if we select any year from year dropdown, it should compare with previous year&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Ex1: If we choose 2024, the comparison should be 2024 vs. 2023, and it should show by quarterly.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Ex2: If we select 2020, the comparison should be 2020 against 2019, and it should show by quarterly.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;The table should show like below.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;----------------------------------------------------------------------&lt;BR /&gt;I created below measures&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT size="2"&gt;Previous = var _s = SELECTEDVALUE (Date[tDate]. [Year])&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;RETURN &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;CALCULATE(SUM(Sales[Amount]),FILTER(Sales,YEAR([Date])=_s))&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;,&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&lt;FONT size="2"&gt;Previous = var _s = SELECTEDVALUE(Date[tDate]. [Year]) -1&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;RETURN &lt;/FONT&gt;&lt;BR /&gt;&lt;FONT size="2"&gt;CALCULATE(SUM(Sales[Amount]),FILTER(Sales,YEAR([Date])=_s))&lt;/FONT&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;O/P with the above measures.&lt;BR /&gt;For select year (2023), the previous column is coming as blank, and the previous year (2022) current column is coming as blank.&lt;BR /&gt;&lt;BR /&gt;For quarters, we have to go with the drill throw option. Without drillthrough, is there any other option?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;I tried with field parameters also, but o/p is the same.&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Parameter = {&lt;BR /&gt;("Current", NAMEOF('Measure'[Current]), 0),&lt;BR /&gt;("Previous", NAMEOF('Measure'[Previous]), 1)&lt;BR /&gt;}&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;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 19 Nov 2024 15:37:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4291400#M170297</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-19T15:37:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the values based on the user's selected year Vs previous year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4292176#M170315</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;Try changing your Previous measure using the time-intelligence function SAMEPERIODLASTYEAR() like this:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Previous = CALCULATE(
    SUM(SalesTable[Amount]),
    SAMEPERIODLASTYEAR(DateTable[Date])
)&lt;/LI-CODE&gt;
&lt;P&gt;Current measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Current = CALCULATE(
    SUM(SalesTable[Amount]),
    YEAR(SalesTable[Date]) = SELECTEDVALUE(DateTable[Year])
)&lt;/LI-CODE&gt;
&lt;P&gt;&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;Best Regards,&lt;BR /&gt;Jarvis Tang&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Nov 2024 02:13:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4292176#M170315</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-20T02:13:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to compare the values based on the user's selected year Vs previous year.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4301401#M170804</link>
      <description>&lt;P&gt;&lt;FONT&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&lt;/FONT&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry to bother you.&lt;/P&gt;
&lt;P&gt;I would like ask if my previous reply has helped you resolved the problem? If so, please consider accepting the previous reply as a solution.&amp;nbsp;This will make it easier for other users experiencing the same problem to find a solution.&lt;/P&gt;
&lt;P&gt;If you have any other questions, please feel free to contact me.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jarvis Tang&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Nov 2024 06:31:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-compare-the-values-based-on-the-user-s-selected-year-Vs/m-p/4301401#M170804</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-26T06:31:23Z</dc:date>
    </item>
  </channel>
</rss>

