<?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: Calculating Variance based on the year selection in slicer in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3975536#M154149</link>
    <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 06 Jun 2024 00:33:39 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-06-06T00:33:39Z</dc:date>
    <item>
      <title>Calculating Variance based on the year selection in slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3974796#M154130</link>
      <description>&lt;P&gt;I have to create a dashboard calculating variance between three different values which are Amount, Fee and count. DB needs to have a slicer enabling user to select current year and any prvious year e.g, 2024 verses 2023 and so on. Dasboard should show the variance percentage based on user selection. Can anyone please help. TIA&lt;/P&gt;</description>
      <pubDate>Wed, 05 Jun 2024 15:22:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3974796#M154130</guid>
      <dc:creator>BUSH781</dc:creator>
      <dc:date>2024-06-05T15:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Variance based on the year selection in slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3975536#M154149</link>
      <description>&lt;P&gt;Please provide sample data that covers your issue or question &lt;STRONG&gt;completely&lt;/STRONG&gt;, in a &lt;STRONG&gt;usable&lt;/STRONG&gt; format (not as a screenshot).&lt;BR /&gt;&lt;BR /&gt;Do not include sensitive information or anything not related to the issue or question. &lt;BR /&gt;&lt;BR /&gt;If you are unsure how to upload data please refer to &lt;A href="https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-p/963216&lt;/A&gt; &lt;BR /&gt;&lt;BR /&gt;Please show the expected outcome based on the sample data you provided. &lt;BR /&gt;&lt;BR /&gt;Want faster answers? &lt;A href="https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523" target="_blank"&gt;https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 00:33:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3975536#M154149</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-06-06T00:33:39Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Variance based on the year selection in slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3977825#M154233</link>
      <description>&lt;TABLE border="0" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Amount&lt;/TD&gt;&lt;TD&gt;year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;150BN&lt;/TD&gt;&lt;TD&gt;2024&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;50BN&lt;/TD&gt;&lt;TD&gt;2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;30BN&lt;/TD&gt;&lt;TD&gt;2022&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;Slicer will be based on year column and it can be selected in any combination with current year if 2024 and 2023 is selected the output should be 100bn and if 2024 and 2022 is selected then output should be 20bn.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Jun 2024 18:35:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3977825#M154233</guid>
      <dc:creator>BUSH781</dc:creator>
      <dc:date>2024-06-06T18:35:45Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating Variance based on the year selection in slicer</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3985634#M154516</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;Thanks for your contribution on this thread.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="755159" data-lia-user-login="BUSH781" class="lia-mention lia-mention-user"&gt;BUSH781&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below to get it, please find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variance = 
VAR _curyear =
    YEAR ( TODAY () )
VAR _selyear =
    SELECTEDVALUE ( 'Table'[year] )
VAR _cyamount =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER ( ALL ( 'Table' ), 'Table'[year] = _curyear )
    )
VAR _syamount =
    CALCULATE (
        SUM ( 'Table'[Amount] ),
        FILTER ( 'Table', 'Table'[year] = _selyear )
    )
RETURN
    _cyamount - _syamount&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 11 Jun 2024 09:35:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-Variance-based-on-the-year-selection-in-slicer/m-p/3985634#M154516</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-11T09:35:33Z</dc:date>
    </item>
  </channel>
</rss>

