<?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: Adding Rows to get a Total in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3614855#M139751</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="289633" data-lia-user-login="Yrstruly2021" class="lia-mention lia-mention-user"&gt;Yrstruly2021&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't open your pbix file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide detailed sample data and the results you are hoping for again. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _Yuliax&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jan 2024 07:26:28 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-01-04T07:26:28Z</dc:date>
    <item>
      <title>Adding Rows to get a Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3612912#M139677</link>
      <description>&lt;P&gt;Please assist. I am trying to get the total value for&amp;nbsp;&lt;STRONG&gt;Tax paid&lt;/STRONG&gt; which is made up of&amp;nbsp;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Tax paid&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tax refunded&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Fiscal unity tax transfers&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Tax cash flow adjustments&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;These columns has got values, accept for Tax cash flow adjustment which is correct:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I am using DAX:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CombinedAmount = 
VAR SelectedCashFlowDescription = SELECTEDVALUE('CashflowDiscriptions'[description], "None")
RETURN
    IF(
        SelectedCashFlowDescription = "Interco capital returned",
        678,
        CALCULATE(
            SUM('ZTBR'[Amount in USD]),
            'ZTBR'[Roll_Up_Function] IN {
                "Cash flow from ops - management",
                "Cash flow from trading",
                "Profit before Brambles allocations Total",
                "Depreciation and amortisation",
                "IPEP expense",
                "Disposals &amp;amp; impairment of fixed assets",
                "Profit on disposal of pooling equipment",
                "Scrapped pooling equipment",
                "Impairment or valuation adjustment of pooling equipment",
                "Disposals or valuation adjustments of other fixed assets",
                "Other cash flow from trading adjustments",
                "Share-based payments expense",
                "Working capital mvts excl. provisions",
                "Debtor movements",
                "Creditor movements",
                "Inventory movements",
                "Prepayment movements",
                "Provision movements",
                "Change in capex creditors",
                "Brambles allocations not in mgt cash flow",
                "Interco interest and guarantee fees",
                "Interco cash flows",
                "Interco royalties",
                "Statutory reallocations",
                "Internal restructuring",
                "Interco dividends Total",
                "Change in interco balances",
                "Change in interco recharge clearing",
                "FX on interco debt",
                "Interco capital returned",
                "Interco cash flow adjustments",
                "Interest expense Total",
                "Interest revenue",
                "Interest received",
                "Lease interest"
            }
        ) + CALCULATE(
            SUM(Bracs[Metric Value ($)]),
            Bracs[Metric] IN {
                "Pension plan adjustment",
                "Working capital - budget flex",
                "Pooling equipment additions",
                "Pooling equipment replacements",
                "Pooling equipment internal transfers",
                "Other PP&amp;amp;E additions",
                "Other PP&amp;amp;E replacements",
                "Other PP&amp;amp;E internal transfers",
                "Joint venture loans",
                "WDV pooling equip. disposals &amp;amp; write-offs",
                "Gain pooling equip. disposals &amp;amp; write-offs",
                "WDV other PP&amp;amp;E disposals",
                "Profit other PP&amp;amp;E disposals",
                "Discount unwind on long term provisions",
                "Tax paid",
                "Tax refunded",
                "Fiscal unity tax transfers",
                "Other cash flow items",
                "FX adjustments to cash flow",
				"Change in cash net of overdraft"
            }
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To get values above. The DAX i tried to get&amp;nbsp;Net tax paid gives no output:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NetTaxPaidTest = 
CALCULATE(
    SUM(Bracs[Metric Value ($)]),
    Bracs[Metric] IN {
        "Tax paid",
        "Tax refunded",
        "Fiscal unity tax transfers",
        "Tax cash flow adjustments"
    }
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;PBIX:&lt;A href="https://drive.google.com/file/d/1nSBwCKqxdEYe-pmK9UX2nPDV7XOpinfO/view?usp=sharing" target="_self"&gt;https://drive.google.com/file/d/1nSBwCKqxdEYe-pmK9UX2nPDV7XOpinfO/view?usp=sharing&lt;/A&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Table CashFlowDescriptions[Descriptions] include the row Net Tax Paid, as well as the rows that made up this amount. Te Bracs table contains the values. I cant seem to get this row to display the total of the three rows that it is made up of.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Jan 2024 16:30:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3612912#M139677</guid>
      <dc:creator>Yrstruly2021</dc:creator>
      <dc:date>2024-01-03T16:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Rows to get a Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3614855#M139751</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="289633" data-lia-user-login="Yrstruly2021" class="lia-mention lia-mention-user"&gt;Yrstruly2021&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I can't open your pbix file.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please provide detailed sample data and the results you are hoping for again. We can better understand the problem and help you. Show it as a screenshot or excel. Please remove any sensitive data in advance.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Community Support Team _Yuliax&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 07:26:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3614855#M139751</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-01-04T07:26:28Z</dc:date>
    </item>
    <item>
      <title>Re: Adding Rows to get a Total</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3615712#M139782</link>
      <description>&lt;P&gt;I have found a solution using codes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NetTaxPaid = 
CALCULATE(
SUM(Bracs[Metric Value ($)]),
Bracs[Metric] IN {
"Tax paid",
"Tax refunded",
"Fiscal unity tax transfers",
"Tax cash flow adjustments"
}
)

AND 

New CombinedAmount0 = 
VAR SelectedCashFlowDescription = SELECTEDVALUE('CashflowDiscriptions'[description], "None")
VAR _TotalNetTaxPaid = CALCULATE([NetTaxPaid], ALL(CashflowDiscriptions))

RETURN
    SWITCH(
        TRUE(),
        SelectedCashFlowDescription = "Interco capital returned", 678,
        SelectedCashFlowDescription = "Net tax paid", _TotalNetTaxPaid,
        SelectedCashFlowDescription = "Leases principal repaid",
            CALCULATE(
                SUM('Bracs'[Metric Value ($)]),
                'Bracs'[Metric] = "Leases principal repaid"
            ),
        CALCULATE(
            SUM('ZTBR'[Amount in USD]),
            'ZTBR'[Roll_Up_Function] IN {
                "Cash flow from ops - management",
                "Cash flow from trading",
                "Profit before Brambles allocations Total",
                "Depreciation and amortisation",
                "IPEP expense",
                "Disposals &amp;amp; impairment of fixed assets",
                "Profit on disposal of pooling equipment",
                "Scrapped pooling equipment",
                "Impairment or valuation adjustment of pooling equipment",
                "Disposals or valuation adjustments of other fixed assets",
                "Other cash flow from trading adjustments",
                "Share-based payments expense",
                "Working capital mvts excl. provisions",
                "Debtor movements",
                "Creditor movements",
                "Inventory movements",
                "Prepayment movements",
                "Provision movements",
                "Change in capex creditors",
                "Brambles allocations not in mgt cash flow",
                "Interco interest and guarantee fees",
                "Interco cash flows",
                "Interco royalties",
                "Statutory reallocations",
                "Internal restructuring",
                "Interco dividends Total",
                "Change in interco balances",
                "Change in interco recharge clearing",
                "FX on interco debt",
                "Interco capital returned",
                "Interco cash flow adjustments",
                "Interest expense Total",
                "Interest revenue",
                "Interest received",
                "Lease interest"
            }
        ) + CALCULATE(
            SUM(Bracs[Metric Value ($)]),
            Bracs[Metric] IN {
                "Pension plan adjustment",
                "Working capital - budget flex",
                "Pooling equipment additions",
                "Pooling equipment replacements",
                "Pooling equipment internal transfers",
                "Other PP&amp;amp;E additions",
                "Other PP&amp;amp;E replacements",
                "Other PP&amp;amp;E internal transfers",
                "Joint venture loans",
                "WDV pooling equip. disposals &amp;amp; write-offs",
                "Gain pooling equip. disposals &amp;amp; write-offs",
                "WDV other PP&amp;amp;E disposals",
                "Profit other PP&amp;amp;E disposals",
                "Discount unwind on long term provisions",
                "Tax paid",
                "Tax refunded",
                "Fiscal unity tax transfers",
                "Other cash flow items",
                "FX adjustments to cash flow",
                "Change in cash net of overdraft"
            }
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am trying to to the same for&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Net Debt Increase/(Decrease) = 
VAR LeasesPrincipalRepaid = CALCULATE(
    SUM('Bracs'[Metric Value ($)]),
    'Bracs'[Metric] IN {"Leases principal repaid", "Change in cash net of overdraft"}
)
RETURN 
LeasesPrincipalRepaid
AND

New CombinedAmount = 
VAR SelectedCashFlowDescription = SELECTEDVALUE('CashflowDiscriptions'[description], "None")
VAR _TotalNetTaxPaid = CALCULATE([NetTaxPaid], ALL(CashflowDiscriptions))
VAR _NetDebtIncreaseDecrease = CALCULATE(
    SUM('Bracs'[Metric Value ($)]),
    'Bracs'[Metric] IN {"Leases principal repaid", "Change in cash net of overdraft"}
)

RETURN
    SWITCH(
        TRUE(),
        SelectedCashFlowDescription = "Interco capital returned", 678,
        SelectedCashFlowDescription = "Net tax paid", _TotalNetTaxPaid,
        SelectedCashFlowDescription = "Leases principal repaid",
            CALCULATE(
                SUM('Bracs'[Metric Value ($)]),
                'Bracs'[Metric] = "Leases principal repaid"
            ),
        SelectedCashFlowDescription = "Net debt increase/(decrease)", _NetDebtIncreaseDecrease,
        CALCULATE(
            SUM('ZTBR'[Amount in USD]),
            'ZTBR'[Roll_Up_Function] IN {
                "Cash flow from ops - management",
                "Cash flow from trading",
                "Profit before Brambles allocations Total",
                "Depreciation and amortisation",
                "IPEP expense",
                "Disposals &amp;amp; impairment of fixed assets",
                "Profit on disposal of pooling equipment",
                "Scrapped pooling equipment",
                "Impairment or valuation adjustment of pooling equipment",
                "Disposals or valuation adjustments of other fixed assets",
                "Other cash flow from trading adjustments",
                "Share-based payments expense",
                "Working capital mvts excl. provisions",
                "Debtor movements",
                "Creditor movements",
                "Inventory movements",
                "Prepayment movements",
                "Provision movements",
                "Change in capex creditors",
                "Brambles allocations not in mgt cash flow",
                "Interco interest and guarantee fees",
                "Interco cash flows",
                "Interco royalties",
                "Statutory reallocations",
                "Internal restructuring",
                "Interco dividends Total",
                "Change in interco balances",
                "Change in interco recharge clearing",
                "FX on interco debt",
                "Interco capital returned",
                "Interco cash flow adjustments",
                "Interest expense Total",
                "Interest revenue",
                "Interest received",
                "Lease interest"
            }
        ) + CALCULATE(
            SUM('Bracs'[Metric Value ($)]),
            'Bracs'[Metric] IN {
                "Pension plan adjustment",
                "Working capital - budget flex",
                "Pooling equipment additions",
                "Pooling equipment replacements",
                "Pooling equipment internal transfers",
                "Other PP&amp;amp;E additions",
                "Other PP&amp;amp;E replacements",
                "Other PP&amp;amp;E internal transfers",
                "Joint venture loans",
                "WDV pooling equip. disposals &amp;amp; write-offs",
                "Gain pooling equip. disposals &amp;amp; write-offs",
                "WDV other PP&amp;amp;E disposals",
                "Profit other PP&amp;amp;E disposals",
                "Discount unwind on long term provisions",
                "Tax paid",
                "Tax refunded",
                "Fiscal unity tax transfers",
                "Other cash flow items",
                "FX adjustments to cash flow",
                "Change in cash net of overdraft"
            }
        )
    )&lt;/LI-CODE&gt;&lt;P&gt;Row&amp;nbsp;Net debt increase/(decrease) should display and the total amount of the above calculation should be assigned to it. Just not getting this right. The link is active.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jan 2024 13:49:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adding-Rows-to-get-a-Total/m-p/3615712#M139782</guid>
      <dc:creator>Yrstruly2021</dc:creator>
      <dc:date>2024-01-04T13:49:00Z</dc:date>
    </item>
  </channel>
</rss>

