<?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 Display totals for parent item(s) in hierarchy when child selected in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2500833#M69142</link>
    <description>&lt;P&gt;Working with a geo hierarchy Region&amp;gt;State&amp;gt;City. Have a measure that calculates Average Cost. Customer wants a report that allows them to select a City using a slicer and see the average cost for each level of the heirarchy on three separate cards. So in other words if they select 'Albany' in the slicer, the City card would show Average Cost for 'Albany', the State card for 'New York', and the Region card for 'Northeast'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tinkered with VALUES and ALLEXCEPT thinking that I need to remove the lower hierarchy filters but I just can't get it. Any ideas?&lt;/P&gt;</description>
    <pubDate>Mon, 09 May 2022 05:08:39 GMT</pubDate>
    <dc:creator>tnwcloud</dc:creator>
    <dc:date>2022-05-09T05:08:39Z</dc:date>
    <item>
      <title>Display totals for parent item(s) in hierarchy when child selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2500833#M69142</link>
      <description>&lt;P&gt;Working with a geo hierarchy Region&amp;gt;State&amp;gt;City. Have a measure that calculates Average Cost. Customer wants a report that allows them to select a City using a slicer and see the average cost for each level of the heirarchy on three separate cards. So in other words if they select 'Albany' in the slicer, the City card would show Average Cost for 'Albany', the State card for 'New York', and the Region card for 'Northeast'.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've tinkered with VALUES and ALLEXCEPT thinking that I need to remove the lower hierarchy filters but I just can't get it. Any ideas?&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 05:08:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2500833#M69142</guid>
      <dc:creator>tnwcloud</dc:creator>
      <dc:date>2022-05-09T05:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: Display totals for parent item(s) in hierarchy when child selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2500880#M69144</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284884" data-lia-user-login="tnwcloud" class="lia-mention lia-mention-user"&gt;tnwcloud&lt;/a&gt; , Measure for state , Assume you already have Avg Cost Measure &lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meausre =&lt;/P&gt;
&lt;P&gt;var _tab = summarize(allselected(Geo), Geo[State])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;calculate([Avg Cost), filter(all(Geo), Geo[State] in _tab ) )&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Meausre =&lt;/P&gt;
&lt;P&gt;var _tab = summarize(allselected(Geo), Geo[Region])&lt;/P&gt;
&lt;P&gt;return&lt;/P&gt;
&lt;P&gt;calculate([Avg Cost), filter(all(Geo), Geo[Region] in _tab ) )&lt;/P&gt;</description>
      <pubDate>Mon, 09 May 2022 05:40:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2500880#M69144</guid>
      <dc:creator>amitchandak</dc:creator>
      <dc:date>2022-05-09T05:40:56Z</dc:date>
    </item>
    <item>
      <title>Re: Display totals for parent item(s) in hierarchy when child selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2502559#M69216</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="148838" data-lia-user-login="amitchandak" class="lia-mention lia-mention-user"&gt;amitchandak&lt;/a&gt; it worked for Region but not for State. Any idea why it might work for the top of the hierarchy but not lower down?&lt;/P&gt;</description>
      <pubDate>Tue, 10 May 2022 04:57:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2502559#M69216</guid>
      <dc:creator>tnwcloud</dc:creator>
      <dc:date>2022-05-10T04:57:00Z</dc:date>
    </item>
    <item>
      <title>Re: Display totals for parent item(s) in hierarchy when child selected</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2509800#M69586</link>
      <description>&lt;P&gt;Hi&amp;nbsp; &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="284884" data-lia-user-login="tnwcloud" class="lia-mention lia-mention-user"&gt;tnwcloud&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I created some data:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Here are the steps you can follow：&lt;/P&gt;
&lt;P&gt;1. Create measure.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;City_Avg =
var _sleect=SELECTEDVALUE('Table'[City])
return
CALCULATE(AVERAGE('Table'[Amount]),FILTER(ALL('Table'),'Table'[City]=_sleect))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;State_Avg =
var _select=SELECTEDVALUE('Table'[City])
var _status=CALCULATE(MAX('Table'[State]),FILTER(ALL('Table'),_select in SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[State]=EARLIER('Table'[State])),"1",[City])))
return
CALCULATE(AVERAGE('Table'[Amount]),FILTER(ALL('Table'),'Table'[State]=_status))&lt;/LI-CODE&gt;&lt;LI-CODE lang="markup"&gt;Region_Avg =
var _select=SELECTEDVALUE('Table'[City])
var _status=CALCULATE(MAX('Table'[State]),FILTER(ALL('Table'),_select in SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[State]=EARLIER('Table'[State])),"1",[City])))
var _region=CALCULATE(MAX('Table'[Region]),FILTER(ALL('Table'),_status in SELECTCOLUMNS(FILTER(ALL('Table'),'Table'[Region]=EARLIER('Table'[Region])),"1",[State])))
return
CALCULATE(AVERAGE('Table'[Amount]),FILTER(ALL('Table'),'Table'[Region]=_region)
)&lt;/LI-CODE&gt;
&lt;P&gt;2. Result:&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;/P&gt;
&lt;P&gt;Liu Yang&lt;/P&gt;
&lt;P&gt;If this post &lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider &lt;EM&gt;Accept it as the solution&lt;/EM&gt; to help the other members find it more quickly&lt;/P&gt;</description>
      <pubDate>Thu, 12 May 2022 07:51:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Display-totals-for-parent-item-s-in-hierarchy-when-child/m-p/2509800#M69586</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-05-12T07:51:23Z</dc:date>
    </item>
  </channel>
</rss>

