<?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: Calculating sum of values of two categories and showing it as the third category as balancing in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3812055#M149087</link>
    <description>&lt;P&gt;You don't only need the number, you also need the statement account value for that Foreign Currency Translation.&amp;nbsp; Is that part of your dimension table?&lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2024 22:11:48 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2024-04-04T22:11:48Z</dc:date>
    <item>
      <title>Calculating sum of values of two categories and showing it as the third category as balancing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3811198#M149054</link>
      <description>&lt;P&gt;Hello, DAX Wizzards&lt;BR /&gt;I have three types of accounts in the Balance Sheet:&lt;BR /&gt;1. &lt;STRONG&gt;Aggregation&lt;/STRONG&gt; that is a measure of Running Total multiplied by the end of the month FX rate.&lt;BR /&gt;2. &lt;STRONG&gt;Fixed Rate Valuation&lt;/STRONG&gt; that is a measure of Running Total at historical FX rate&lt;BR /&gt;3. &lt;STRONG&gt;Foreign Currency Translation&lt;/STRONG&gt; that is to be an opposite sum of &lt;STRONG&gt;Aggregation&lt;/STRONG&gt; and &lt;STRONG&gt;Fixed Rate Valuation&lt;/STRONG&gt;&lt;BR /&gt;In example below I would like to show another line before &lt;STRONG&gt;Total&lt;/STRONG&gt;&amp;nbsp; that is to be -3,391,740.18 which is then turns &lt;STRONG&gt;Total&lt;/STRONG&gt; into zero&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I have half written my DAX&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;@Test3 Trial Balance Amount  (FX Rate) = 

VAR FCTR_BS =
   CALCULATE([Aggregation BSheet Accounts],
       VALUES( 'NL Mapping'[FX Valuation]),
       'NL Mapping'[FX Valuation] = "Aggregation")
        
VAR FCTR_FixRate = 
       CALCULATE(
        [Running Totals (FX historical, with spill)],
          VALUES( 'NL Mapping'[FX Valuation]),
       'NL Mapping'[FX Valuation] = "Fixed Rate Valuation")
        

//VAR FCTR = 
// DAX to be inserted


VAR Result =
    FCTR_BS+FCTR_FixRate+FCTR
RETURN
    Result&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;Could you please help me, if at all?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Thank you very much indeed&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 14:18:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3811198#M149054</guid>
      <dc:creator>MiraAbel</dc:creator>
      <dc:date>2024-04-04T14:18:47Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of values of two categories and showing it as the third category as balancing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3812055#M149087</link>
      <description>&lt;P&gt;You don't only need the number, you also need the statement account value for that Foreign Currency Translation.&amp;nbsp; Is that part of your dimension table?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 22:11:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3812055#M149087</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2024-04-04T22:11:48Z</dc:date>
    </item>
    <item>
      <title>Re: Calculating sum of values of two categories and showing it as the third category as balancing</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3817431#M149298</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="100342" data-lia-user-login="lbendlin" class="lia-mention lia-mention-user"&gt;lbendlin&lt;/a&gt;&amp;nbsp;,thanks for the quick reply, I'll add further.&lt;/P&gt;
&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="510389" data-lia-user-login="MiraAbel" class="lia-mention lia-mention-user"&gt;MiraAbel&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The Table data is shown below:(The last line was added manually by me)&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;1. Use the following DAX expression to create a column&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Column = SWITCH(TRUE(),
'Table'[Balance Sheet] = "A",1,
'Table'[Balance Sheet] = "B",2)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;2. Use the following DAX expression to create a measure&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
var _a = CALCULATE(SUM('Table'[Amount]),VALUES('Table'[Balance Sheet]),'Table'[Balance Sheet] = "A")
VAR _b = CALCULATE(SUM('Table'[Amount]),VALUES('Table'[Balance Sheet]),'Table'[Balance Sheet] = "B")
VAR _c = CALCULATE(SUMX(FILTER('Table','Table'[Balance Sheet] = "A"),[Amount]),ALL('Table'[Balance Sheet]))
VAR _d = CALCULATE(SUMX(FILTER('Table','Table'[Balance Sheet] = "B"),[Amount]),ALL('Table'[Balance Sheet]))
RETURN 
IF(MAX('Table'[Amount]) = BLANK(),-(_c+_d),
IF(SELECTEDVALUE('Table'[Column]),_a+_b,
IF(COUNTROWS('Table') &amp;lt;&amp;gt; COUNTAX(ALL('Table'),[Balance Sheet]) ,_a+_b,
0)))
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;3. Final output&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Wenbin Zhou&lt;BR /&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Mon, 08 Apr 2024 03:11:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Calculating-sum-of-values-of-two-categories-and-showing-it-as/m-p/3817431#M149298</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-04-08T03:11:50Z</dc:date>
    </item>
  </channel>
</rss>

