<?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: Suming Ledger Turnover in a Project matrix table in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338494#M172267</link>
    <description>&lt;P&gt;Hi Adamk Kong,&lt;BR /&gt;Thanks for you're involvement.&lt;BR /&gt;Your solution still adds up all instances in the ERR-98&lt;/P&gt;</description>
    <pubDate>Fri, 20 Dec 2024 10:29:06 GMT</pubDate>
    <dc:creator>Geiern</dc:creator>
    <dc:date>2024-12-20T10:29:06Z</dc:date>
    <item>
      <title>Suming Ledger Turnover in a Project matrix table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4336610#M172194</link>
      <description>&lt;P&gt;Dear Community,&lt;/P&gt;&lt;P&gt;I have a Project table and Ledger table.&lt;BR /&gt;Project table has a line pr month, pr ProjectID.&lt;BR /&gt;All instances in Ledger table should have a ProjectID&lt;BR /&gt;It is possible to have BLANK ProjectID in Ledger, so I make a “Project” out of the blanks and collect them.&lt;BR /&gt;It is also possible to have ProjectIDs in the Ledger that does not exist in the Project table so I make a “Project” out of these too.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In the Project table I make a calculated column like this:&lt;BR /&gt;Turnover =&lt;/P&gt;&lt;P&gt;SUMX (FILTER (&lt;BR /&gt;Ledger,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project[StartDate] &amp;lt;= Ledger[ValDate]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; Project[EndDate] &amp;gt;= Ledger[ValDate]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; Project[Owning Business Unit] = Ledger[Owning Business Unit]&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; Ledger[AcNo] &amp;gt;= 3000&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; Ledger[AcNo] &amp;lt; 4000&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;amp;&amp;amp; SWITCH (&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; TRUE,&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project[PID] = Ledger[PID], Ledger[PID] = Project[PID],&amp;nbsp; &amp;nbsp; &amp;nbsp;// Success&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; ISBLANK (Ledger[PID]), Project[PID] = "ERR-99",&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Missing PID in Ledger&lt;BR /&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; Project[PID] = "ERR-98"&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;// Missing PID in Project&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; )&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; ),&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; Ledger[AcAm(Base)]&lt;/P&gt;&lt;P&gt;)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Output of this calculated column is working fine on both TRUE statements, but it sums all instances in the ELSE statement (including the error).&lt;BR /&gt;Thanks for any help &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt; &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 09:24:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4336610#M172194</guid>
      <dc:creator>Geiern</dc:creator>
      <dc:date>2024-12-19T09:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Suming Ledger Turnover in a Project matrix table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4336675#M172195</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219573" data-lia-user-login="Geiern" class="lia-mention lia-mention-user"&gt;Geiern&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To prevent unwanted rows from being included, explicitly filter them out using the FILTER function before applying SUMX.&lt;/P&gt;&lt;PRE&gt;Turnover =&lt;BR /&gt;SUMX (&lt;BR /&gt;FILTER (&lt;BR /&gt;Ledger,&lt;BR /&gt;Project[StartDate] &amp;lt;= Ledger[ValDate]&lt;BR /&gt;&amp;amp;&amp;amp; Project[EndDate] &amp;gt;= Ledger[ValDate]&lt;BR /&gt;&amp;amp;&amp;amp; Project[Owning Business Unit] = Ledger[Owning Business Unit]&lt;BR /&gt;&amp;amp;&amp;amp; Ledger[AcNo] &amp;gt;= 3000&lt;BR /&gt;&amp;amp;&amp;amp; Ledger[AcNo] &amp;lt; 4000&lt;BR /&gt;&amp;amp;&amp;amp; SWITCH (&lt;BR /&gt;TRUE,&lt;BR /&gt;Project[PID] = Ledger[PID], TRUE, &lt;BR /&gt;ISBLANK ( Ledger[PID] ) &amp;amp;&amp;amp; Project[PID] = "ERR-99", TRUE, &lt;BR /&gt;Project[PID] = "ERR-98", TRUE, &lt;BR /&gt;FALSE &lt;BR /&gt;)&lt;BR /&gt;),&lt;BR /&gt;Ledger[AcAm(Base)]&lt;BR /&gt;)&lt;/PRE&gt;&lt;P&gt;&lt;span class="lia-unicode-emoji" title=":love_letter:"&gt;💌&lt;/span&gt; &lt;STRONG&gt;If this helped, a Kudos &lt;span class="lia-unicode-emoji" title=":thumbs_up:"&gt;👍&lt;/span&gt; or Solution mark &lt;span class="lia-unicode-emoji" title=":white_heavy_check_mark:"&gt;✅&lt;/span&gt; would be great! &lt;span class="lia-unicode-emoji" title=":party_popper:"&gt;🎉&lt;/span&gt;&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Cheers,&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;Kedar&lt;/STRONG&gt;&lt;BR /&gt;&lt;STRONG&gt;&lt;A href="https://www.linkedin.com/in/kedar-pande" target="_blank" rel="noopener"&gt;Connect on LinkedIn&lt;/A&gt;&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 19 Dec 2024 10:00:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4336675#M172195</guid>
      <dc:creator>Kedar_Pande</dc:creator>
      <dc:date>2024-12-19T10:00:24Z</dc:date>
    </item>
    <item>
      <title>Re: Suming Ledger Turnover in a Project matrix table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338215#M172257</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219573" data-lia-user-login="Geiern" class="lia-mention lia-mention-user"&gt;Geiern&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The issue you are facing is that the formula sums all instances in the ELSE statement, including the errors. To address this, you can modify the formula to handle the ELSE cases separately and ensure that only valid instances are summed.&lt;/P&gt;
&lt;P&gt;You can modify your formula like below:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Turnover = 
SUMX (
    FILTER (
        Ledger,
        Project[StartDate] &amp;lt;= Ledger[ValDate] &amp;amp;&amp;amp;
        Project[EndDate] &amp;gt;= Ledger[ValDate] &amp;amp;&amp;amp;
        Project[Owning Business Unit] = Ledger[Owning Business Unit] &amp;amp;&amp;amp;
        Ledger[AcNo] &amp;gt;= 3000 &amp;amp;&amp;amp;
        Ledger[AcNo] &amp;lt; 4000 &amp;amp;&amp;amp;
        (
            (Project[PID] = Ledger[PID] &amp;amp;&amp;amp; NOT ISBLANK(Ledger[PID])) || 
            (ISBLANK(Ledger[PID]) &amp;amp;&amp;amp; Project[PID] = "ERR-99") || 
            (Project[PID] = "ERR-98")
        )
    ),
    Ledger[AcAm(Base)]
)&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;Adamk Kong&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&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;</description>
      <pubDate>Fri, 20 Dec 2024 07:43:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338215#M172257</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-20T07:43:38Z</dc:date>
    </item>
    <item>
      <title>Re: Suming Ledger Turnover in a Project matrix table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338492#M172266</link>
      <description>&lt;P&gt;Hi Kedar_Pande,&lt;BR /&gt;Thanks for you're involvement.&lt;BR /&gt;Your solution still adds up all instances in the ERR-98&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 10:28:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338492#M172266</guid>
      <dc:creator>Geiern</dc:creator>
      <dc:date>2024-12-20T10:28:23Z</dc:date>
    </item>
    <item>
      <title>Re: Suming Ledger Turnover in a Project matrix table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338494#M172267</link>
      <description>&lt;P&gt;Hi Adamk Kong,&lt;BR /&gt;Thanks for you're involvement.&lt;BR /&gt;Your solution still adds up all instances in the ERR-98&lt;/P&gt;</description>
      <pubDate>Fri, 20 Dec 2024 10:29:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4338494#M172267</guid>
      <dc:creator>Geiern</dc:creator>
      <dc:date>2024-12-20T10:29:06Z</dc:date>
    </item>
    <item>
      <title>Re: Suming Ledger Turnover in a Project matrix table</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4340396#M172340</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="219573" data-lia-user-login="Geiern" class="lia-mention lia-mention-user"&gt;Geiern&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide the test data related to the formula as well as the model, so that I can answer your question as soon as possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Adamk Kong&lt;/P&gt;</description>
      <pubDate>Mon, 23 Dec 2024 07:07:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Suming-Ledger-Turnover-in-a-Project-matrix-table/m-p/4340396#M172340</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-12-23T07:07:46Z</dc:date>
    </item>
  </channel>
</rss>

