<?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 DAX help - distributed sum in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324138#M171672</link>
    <description>&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX requirements I'm faced with is include to be able to distribute project cost (or settlement) to other project based on precentage. The basis for DAX is two tables one &lt;STRONG&gt;dim_WBS&lt;/STRONG&gt; dimension table, and one &lt;STRONG&gt;fact_Cost&lt;/STRONG&gt; transactions table were relationship one-to-many by a&amp;nbsp;&lt;STRONG&gt;WBS&lt;/STRONG&gt; id.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Tables:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;dim_WBS&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fact_COST&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This table include column which is from Excel calculated column, and the number should be calculated by DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current DAX:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried other DAX but gives wrong result. Let me know where am wrong on this code.&lt;BR /&gt;Professional DAX people, your help is highly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;gselvag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 11 Dec 2024 14:48:00 GMT</pubDate>
    <dc:creator>geirselvag</dc:creator>
    <dc:date>2024-12-11T14:48:00Z</dc:date>
    <item>
      <title>DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324138#M171672</link>
      <description>&lt;P&gt;Hello folks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The DAX requirements I'm faced with is include to be able to distribute project cost (or settlement) to other project based on precentage. The basis for DAX is two tables one &lt;STRONG&gt;dim_WBS&lt;/STRONG&gt; dimension table, and one &lt;STRONG&gt;fact_Cost&lt;/STRONG&gt; transactions table were relationship one-to-many by a&amp;nbsp;&lt;STRONG&gt;WBS&lt;/STRONG&gt; id.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;Tables:&lt;/U&gt;&lt;/P&gt;&lt;P&gt;dim_WBS&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;fact_COST&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;This table include column which is from Excel calculated column, and the number should be calculated by DAX.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Current DAX:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried other DAX but gives wrong result. Let me know where am wrong on this code.&lt;BR /&gt;Professional DAX people, your help is highly appreciated.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Best regards,&lt;/P&gt;&lt;P&gt;gselvag&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 11 Dec 2024 14:48:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324138#M171672</guid>
      <dc:creator>geirselvag</dc:creator>
      <dc:date>2024-12-11T14:48:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324250#M171677</link>
      <description>&lt;P&gt;You can use RELATED to get the value of column on the one-side of a relationship when you have a row context on the many-side.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Distributed cost =
SUMX ( fact_Cost, fact_Cost[Cost] * ( 1 + RELATED ( dim_wbs[Percent] ) ) )
&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 11 Dec 2024 15:48:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324250#M171677</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2024-12-11T15:48:05Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324838#M171706</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340229" data-lia-user-login="geirselvag" class="lia-mention lia-mention-user"&gt;geirselvag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can create a calculated column in fact_COST table with the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cost_Distributed = 
VAR NewWBS = IF(RELATED(dim_WBS[Settlement_WBS]) = BLANK(), fact_COST[WBS], RELATED(dim_WBS[Settlement_WBS]))
VAR OriginalCost = LOOKUPVALUE(fact_COST[Cost], fact_COST[WBS], NewWBS)
VAR Distributed = OriginalCost * RELATED(dim_WBS[Percent])
RETURN
IF(fact_COST[WBS] = NewWBS, 0, fact_COST[Cost] + Distributed)&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;BR /&gt;Jarvis Tang&lt;BR /&gt;If this post &lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;, then please consider &lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt; to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 12 Dec 2024 02:41:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4324838#M171706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-12T02:41:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4337197#M172210</link>
      <description>&lt;P&gt;Thanks, but calculated column is not what am looking for.&amp;nbsp;The solution to my issue should be solved as a DAX measure.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Best regards,&lt;BR /&gt;Geir&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 14:59:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4337197#M172210</guid>
      <dc:creator>geirselvag</dc:creator>
      <dc:date>2024-12-19T14:59:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4337795#M172240</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340229" data-lia-user-login="geirselvag" class="lia-mention lia-mention-user"&gt;geirselvag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try to create the following measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cost_Distributed_Measure = 
VAR CurrentWBS = SELECTEDVALUE(fact_COST[WBS])
VAR CurrentCOST = SELECTEDVALUE(fact_COST[Cost])
VAR NewWBS = IF(
    ISBLANK(LOOKUPVALUE(dim_WBS[Settlement_WBS], dim_WBS[WBS], CurrentWBS)),
    CurrentWBS,
    LOOKUPVALUE(dim_WBS[Settlement_WBS], dim_WBS[WBS], CurrentWBS)
)
VAR OriginalCost = CALCULATE(
    SUM(fact_COST[Cost]),
    fact_COST[WBS] = NewWBS,
    REMOVEFILTERS(fact_COST)
)
VAR Distributed = OriginalCost * LOOKUPVALUE(dim_WBS[Percent], dim_WBS[WBS], CurrentWBS)
RETURN
IF(ISBLANK(Distributed), 0, Distributed + CurrentCOST)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jarvis Tang&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 01:52:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4337795#M172240</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-20T01:52:51Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4338113#M172254</link>
      <description>&lt;P&gt;Thanks Jarvis, the measure works fine with one row level. I need this to work with subtotal, as there will be between 1-5 levels in the structure. However the measure works perfect on rowlevel only thing missing is the subtotal and grantotal marked in red.&lt;BR /&gt;&lt;BR /&gt;&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;</description>
      <pubDate>Fri, 20 Dec 2024 07:45:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4338113#M172254</guid>
      <dc:creator>geirselvag</dc:creator>
      <dc:date>2024-12-20T07:45:59Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4342818#M172440</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="340229" data-lia-user-login="geirselvag" class="lia-mention lia-mention-user"&gt;geirselvag&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Sorry for the late reply.&lt;/P&gt;
&lt;P&gt;Try to update the measure with the following DAX:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Cost_Distributed_Measure = 
SUMX(
    fact_COST,
    VAR CurrentWBS = fact_COST[WBS]
    VAR CurrentCOST = fact_COST[Cost]
    VAR NewWBS = IF(
        ISBLANK(LOOKUPVALUE(dim_WBS[Settlement_WBS], dim_WBS[WBS], CurrentWBS)),
        CurrentWBS,
        LOOKUPVALUE(dim_WBS[Settlement_WBS], dim_WBS[WBS], CurrentWBS)
    )
    VAR OriginalCost = CALCULATE(
        SUM(fact_COST[Cost]),
        fact_COST[WBS] = NewWBS,
        REMOVEFILTERS(fact_COST)
    )
    VAR Distributed = OriginalCost * LOOKUPVALUE(dim_WBS[Percent], dim_WBS[WBS], CurrentWBS)
    RETURN
    IF(ISBLANK(Distributed), 0, Distributed + CurrentCOST)
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards,&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Jarvis Tang&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;helps&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;, then please consider&amp;nbsp;&lt;/SPAN&gt;&lt;EM&gt;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&lt;/EM&gt;&lt;SPAN&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Dec 2024 08:46:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4342818#M172440</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-25T08:46:50Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help - distributed sum</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4351877#M172815</link>
      <description>&lt;P&gt;This is excellent work.&lt;BR /&gt;Thank you!&lt;BR /&gt;&lt;BR /&gt;Kind regards,&lt;BR /&gt;Geir&lt;/P&gt;</description>
      <pubDate>Mon, 06 Jan 2025 12:05:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-distributed-sum/m-p/4351877#M172815</guid>
      <dc:creator>geirselvag</dc:creator>
      <dc:date>2025-01-06T12:05:29Z</dc:date>
    </item>
  </channel>
</rss>

