<?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: Nested Calculation item not working in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307358#M171052</link>
    <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variance =
VAR ThisYear =
    CALCULATE ( SELECTEDMEASURE (), DATESYTD ( 'Date'[Date] ) )
VAR LastYear =
    CALCULATE (
        SELECTEDMEASURE (),
        DATEADD ( DATESYTD ( 'Date'[Date] ), -1, YEAR )
    )
VAR Result = ThisYear - LastYear
RETURN
    Result
&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 29 Nov 2024 09:38:26 GMT</pubDate>
    <dc:creator>johnt75</dc:creator>
    <dc:date>2024-11-29T09:38:26Z</dc:date>
    <item>
      <title>Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4306341#M170998</link>
      <description>&lt;P&gt;I have created a calculation item for This Year and Prior Year and wanted to calculate Variance for it.&lt;/P&gt;&lt;P&gt;But the varaince calculation item is not working&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Variance =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;Time_Period&lt;/SPAN&gt;&lt;SPAN&gt;[Time_Period_Grp]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"TY"&lt;/SPAN&gt;&lt;SPAN&gt;) - &amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;Time_Period&lt;/SPAN&gt;&lt;SPAN&gt;[Time_Period_Grp]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"LY"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&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;</description>
      <pubDate>Fri, 29 Nov 2024 05:33:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4306341#M170998</guid>
      <dc:creator>han_rj</dc:creator>
      <dc:date>2024-11-29T05:33:52Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4306349#M171000</link>
      <description>&lt;P&gt;A calculation group is only called once per measure, so you cannot nest them like this. You would either need to have the variance in a separate calculation group or replicate the time intelligence logic in the TY &amp;amp; LY calculation items.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Nov 2024 14:14:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4306349#M171000</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-11-28T14:14:52Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4306851#M171020</link>
      <description>&lt;P&gt;Thank You for responding, I tried both ways did'nt work&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 03:21:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4306851#M171020</guid>
      <dc:creator>han_rj</dc:creator>
      <dc:date>2024-11-29T03:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307205#M171035</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="702570" data-lia-user-login="han_rj" class="lia-mention lia-mention-user"&gt;han_rj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Could you please provide some&amp;nbsp;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;) with&amp;nbsp;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;format and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples?&amp;nbsp;It would be helpful to find out the solution. You can refer the following links to share the required info:&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 29 Nov 2024 07:44:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307205#M171035</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-11-29T07:44:38Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307358#M171052</link>
      <description>&lt;P&gt;Try&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Variance =
VAR ThisYear =
    CALCULATE ( SELECTEDMEASURE (), DATESYTD ( 'Date'[Date] ) )
VAR LastYear =
    CALCULATE (
        SELECTEDMEASURE (),
        DATEADD ( DATESYTD ( 'Date'[Date] ), -1, YEAR )
    )
VAR Result = ThisYear - LastYear
RETURN
    Result
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 29 Nov 2024 09:38:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307358#M171052</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-11-29T09:38:26Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307800#M171074</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;, Thank You for responding&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is the sample data&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Calculation Items used&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Last_Year =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Last_Year_Ind]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Y"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This_Year =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[This_Year_Ind]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Y"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;YOY =&lt;/SPAN&gt; &lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[This_Year_Ind]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Y"&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;SPAN&gt;SELECTEDMEASURE&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;'Table'&lt;/SPAN&gt;&lt;SPAN&gt;[Last_Year_Ind]&lt;/SPAN&gt;&lt;SPAN&gt; = &lt;/SPAN&gt;&lt;SPAN&gt;"Y"&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Current Results&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;Expected&lt;/P&gt;&lt;P&gt;I want variance for the current year only&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Fri, 29 Nov 2024 14:54:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4307800#M171074</guid>
      <dc:creator>han_rj</dc:creator>
      <dc:date>2024-11-29T14:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4309350#M171133</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="702570" data-lia-user-login="han_rj" class="lia-mention lia-mention-user"&gt;han_rj&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try this:&lt;/P&gt;
&lt;P&gt;First of all, Create a measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = SUM('Table'[Sales])&lt;/LI-CODE&gt;
&lt;P&gt;Then add a calculation group:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last_Year = CALCULATE(SELECTEDMEASURE(),'Table'[Last_Year_Ind] = "Y")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;This_Year = CALCULATE(SELECTEDMEASURE(),'Table'[This_Year_Ind] = "Y")&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;YOY =
CALCULATE ( SELECTEDMEASURE (), 'Table'[This_Year_Ind] = "Y" )
    - CALCULATE ( SELECTEDMEASURE (), 'Table'[Last_Year_Ind] = "Y" )
&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Finally, create a Matrix and the result is as follow:&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;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Zhengdong Xu&lt;BR /&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&lt;EM&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 06:38:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4309350#M171133</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-02T06:38:11Z</dc:date>
    </item>
    <item>
      <title>Re: Nested Calculation item not working</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4309361#M171134</link>
      <description>&lt;P&gt;Thank You&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;for responding the format I am looking for is like this&lt;/P&gt;&lt;P&gt;CY, TY label and the Year.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;If we exclude the Year in the column we get the correct results but when we add Year to the column the variance is off like this&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2024 06:44:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Nested-Calculation-item-not-working/m-p/4309361#M171134</guid>
      <dc:creator>han_rj</dc:creator>
      <dc:date>2024-12-02T06:44:21Z</dc:date>
    </item>
  </channel>
</rss>

