<?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 Define row values based on other rows in hierarchy in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2284714#M55989</link>
    <description>&lt;P&gt;I have hierarchical data structure and Account has Sub account naming total and detail, where total always has a value and detail sub accounts may have values. When detail rows have a value sum is equal to total value of each account.&lt;BR /&gt;I want to have a Dax measure when details rows have a value replace total row value with 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Expectecd result.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Herewith attached &lt;A href="https://cslw-my.sharepoint.com/:u:/g/personal/amila_h_creativesoftware_com/Ecix1IubFo9EgApw3Do6_eoB7XwGLcQJZd6U7iJ01bMeVA?e=1hTixN" target="_self"&gt;sample pbix file&lt;/A&gt; for reference.&lt;BR /&gt;Thank you in advance.&lt;/P&gt;</description>
    <pubDate>Sat, 15 Jan 2022 07:06:06 GMT</pubDate>
    <dc:creator>haputhanthree</dc:creator>
    <dc:date>2022-01-15T07:06:06Z</dc:date>
    <item>
      <title>Define row values based on other rows in hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2284714#M55989</link>
      <description>&lt;P&gt;I have hierarchical data structure and Account has Sub account naming total and detail, where total always has a value and detail sub accounts may have values. When detail rows have a value sum is equal to total value of each account.&lt;BR /&gt;I want to have a Dax measure when details rows have a value replace total row value with 0.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Original&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Expectecd result.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Herewith attached &lt;A href="https://cslw-my.sharepoint.com/:u:/g/personal/amila_h_creativesoftware_com/Ecix1IubFo9EgApw3Do6_eoB7XwGLcQJZd6U7iJ01bMeVA?e=1hTixN" target="_self"&gt;sample pbix file&lt;/A&gt; for reference.&lt;BR /&gt;Thank you in advance.&lt;/P&gt;</description>
      <pubDate>Sat, 15 Jan 2022 07:06:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2284714#M55989</guid>
      <dc:creator>haputhanthree</dc:creator>
      <dc:date>2022-01-15T07:06:06Z</dc:date>
    </item>
    <item>
      <title>Re: Define row values based on other rows in hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2284845#M56000</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Here is one way to do this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TotalToZero = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;var&lt;/SPAN&gt; &lt;SPAN&gt;test&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;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TotalToZero[Value]&lt;/SPAN&gt;&lt;SPAN&gt;),&lt;/SPAN&gt;&lt;SPAN&gt;NOT&l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&lt;SPAN&gt;TotalToZero[Subaccount]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;"total"&lt;/SPAN&gt;&lt;SPAN&gt;)))),&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SUM&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;TotalToZero[Value]&lt;/SPAN&gt;&lt;SPAN&gt;))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sat, 15 Jan 2022 13:50:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2284845#M56000</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-15T13:50:48Z</dc:date>
    </item>
    <item>
      <title>Re: Define row values based on other rows in hierarchy</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2285293#M56020</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="343431" data-lia-user-login="ValtteriN" class="lia-mention lia-mention-user"&gt;ValtteriN&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Thank you for the solution.&lt;/P&gt;&lt;P&gt;Update a bit of Original query to get the Main account totals as expected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;TotalToZero =&lt;BR /&gt;VAR DetailSum =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;SUM('Fact Account'[Value])&lt;BR /&gt;,'Dim Account'[isTotalAccount] = 0&lt;BR /&gt;,ALL('Dim Account'[Sub Account])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR Result =&lt;BR /&gt;IF(&lt;BR /&gt;DetailSum &amp;gt; 0 &amp;amp;&amp;amp; ISFILTERED('Dim Account'[Account])&lt;BR /&gt;,CALCULATE(&lt;BR /&gt;SUM('Fact Account'[Value])&lt;BR /&gt;,filter(&lt;BR /&gt;'Dim Account'&lt;BR /&gt;,'Dim Account'[isTotalAccount] = 0&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;,CALCULATE(&lt;BR /&gt;SUM('Fact Account'[Value])&lt;BR /&gt;,filter(&lt;BR /&gt;'Dim Account'&lt;BR /&gt;,'Dim Account'[isTotalAccount] = 1&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;return&lt;/P&gt;&lt;P&gt;Result&lt;/P&gt;</description>
      <pubDate>Sun, 16 Jan 2022 14:55:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Define-row-values-based-on-other-rows-in-hierarchy/m-p/2285293#M56020</guid>
      <dc:creator>haputhanthree</dc:creator>
      <dc:date>2022-01-16T14:55:41Z</dc:date>
    </item>
  </channel>
</rss>

