<?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: Calculation at a specific level in a hierarchy in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4108809#M163048</link>
    <description>&lt;P&gt;Thanks Neeko.&amp;nbsp; Yes this does work and I have done something very similar.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AbsVar(Part) =&lt;/SPAN&gt; &lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PartSite&lt;/SPAN&gt;&lt;SPAN&gt;[Part]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[MainForecastActual]&lt;/SPAN&gt;&lt;SPAN&gt;) but will try it with your ISFILTERED suggestion.&amp;nbsp; This is partly about how to display the correct data at a summarised level without showing the detailed level.&amp;nbsp; I will share some data once I get chance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 20 Aug 2024 08:56:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-08-20T08:56:02Z</dc:date>
    <item>
      <title>Calculation at a specific level in a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4106416#M162956</link>
      <description>&lt;P&gt;I want to be able to calculate an absolute variance between Forecast and Actuals but have the calculation fixed at specific hierarchy levels so when I view it at a higher level it is the sum of the lower level calculations and not claculated at the higher level.&amp;nbsp; For example if I need to calculate Part/Customer/Country how do I fix it at that level.&amp;nbsp; Clearly my formula is too basic,&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AbsVar =&lt;/SPAN&gt; &lt;SPAN&gt;ABS&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Dmd Qty]&lt;/SPAN&gt;&lt;SPAN&gt;-&lt;/SPAN&gt;&lt;SPAN&gt;[Act Qty]&lt;/SPAN&gt;&lt;SPAN&gt;)).&amp;nbsp; Do I use the SELECTVALUE function to force the calculation at a specific level?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Mon, 19 Aug 2024 08:09:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4106416#M162956</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-19T08:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation at a specific level in a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4107993#M163021</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;According to your description, here are my steps you can follow as a solution.&lt;/P&gt;
&lt;P&gt;(1) This is my test data.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;(2) We can create measures.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;AbsVar = ABS(SUM('Table'[Forecast])-SUM('Table'[Actuals]))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;AbsVar2 = IF(ISFILTERED('Table'[Part]),[AbsVar],SUMX(VALUES('Table'[Part]),[AbsVar]))&lt;/LI-CODE&gt;
&lt;P&gt;(3) Then the result is as follows.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the above one can't help you get the desired result, please provide some&amp;nbsp;&lt;STRONG&gt;sample data&lt;/STRONG&gt;&amp;nbsp;in your tables (&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&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;&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.&amp;nbsp;Thank you.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post  &lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution &lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 20 Aug 2024 02:24:35 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4107993#M163021</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-20T02:24:35Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation at a specific level in a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4108809#M163048</link>
      <description>&lt;P&gt;Thanks Neeko.&amp;nbsp; Yes this does work and I have done something very similar.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AbsVar(Part) =&lt;/SPAN&gt; &lt;SPAN&gt;SUMX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;VALUES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;PartSite&lt;/SPAN&gt;&lt;SPAN&gt;[Part]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;[MainForecastActual]&lt;/SPAN&gt;&lt;SPAN&gt;) but will try it with your ISFILTERED suggestion.&amp;nbsp; This is partly about how to display the correct data at a summarised level without showing the detailed level.&amp;nbsp; I will share some data once I get chance.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 20 Aug 2024 08:56:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4108809#M163048</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-20T08:56:02Z</dc:date>
    </item>
    <item>
      <title>Re: Calculation at a specific level in a hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4110475#M163128</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;These two functions are often used in the calculation of hierarchical relationships.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://dax.guide/isfiltered/" target="_blank"&gt;ISFILTERED – DAX Guide&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://medium.com/microsoft-power-bi/isinscope-the-key-to-dynamic-data-drilldowns-10007091e7ba" target="_blank"&gt;DAX ISINSCOPE create dynamic drilldowns in Power BI | Microsoft Power BI (medium.com)&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;With the SWITCH function, you can write different values that need to be output at different levels.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Neeko Tang&lt;/P&gt;
&lt;P&gt;If this post &lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider &lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/EM&gt;&lt;/STRONG&gt; to help the other members find it more quickly.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Aug 2024 06:06:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculation-at-a-specific-level-in-a-hierarchy/m-p/4110475#M163128</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-21T06:06:10Z</dc:date>
    </item>
  </channel>
</rss>

