<?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 Subtract a top row value to another row from Matrix in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-a-top-row-value-to-another-row-from-Matrix/m-p/3222820#M157198</link>
    <description>&lt;P&gt;I am trying to establish a matrix table in PBI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the calculation is subtracting a top row value to another row from a matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used DAX to do the samething.&amp;nbsp;&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;Drivers value2 = 
VAR production =
calculate(sum('Summary Data'[Value])/1000000,
    'Expense Roll up Mapping'[Expense Layer 3] ="Production Labor")
var adl2 =
    calculate(sum('Summary Data'[Value])/1000000,
    'Expense Roll up Mapping'[Expense Layer 3] ="Associate Domestic Labor",
    ALL('Summary Data'[New BU])
    )
var adl =
    calculate(sum('Summary Data'[Value])/1000000,
    'Summary Data'[Expense RollUp_P&amp;amp;L] ="Associate Domestic Labor"
    )
return
    SWITCH(SELECTEDVALUE('Expense Roll up Mapping'[Expense Layer 3]),
    "Production Labor", IF(ISBLANK(production),0, production), 
    "Associate Domestic Labor",  IF(ISBLANK(adl2-production), 0 ,adl2-production))&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the result is the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess that in matrix, my Associate Domestic Labor row in expense layer 3 can't subtract different rows' values, production from the same table.&lt;/P&gt;&lt;P&gt;Is there any way that I can get this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
    <pubDate>Fri, 05 May 2023 20:14:21 GMT</pubDate>
    <dc:creator>jasonjklim</dc:creator>
    <dc:date>2023-05-05T20:14:21Z</dc:date>
    <item>
      <title>Subtract a top row value to another row from Matrix</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-a-top-row-value-to-another-row-from-Matrix/m-p/3222820#M157198</link>
      <description>&lt;P&gt;I am trying to establish a matrix table in PBI.&amp;nbsp;&lt;/P&gt;&lt;P&gt;One of the calculation is subtracting a top row value to another row from a matrix.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example,&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I used DAX to do the samething.&amp;nbsp;&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;Drivers value2 = 
VAR production =
calculate(sum('Summary Data'[Value])/1000000,
    'Expense Roll up Mapping'[Expense Layer 3] ="Production Labor")
var adl2 =
    calculate(sum('Summary Data'[Value])/1000000,
    'Expense Roll up Mapping'[Expense Layer 3] ="Associate Domestic Labor",
    ALL('Summary Data'[New BU])
    )
var adl =
    calculate(sum('Summary Data'[Value])/1000000,
    'Summary Data'[Expense RollUp_P&amp;amp;L] ="Associate Domestic Labor"
    )
return
    SWITCH(SELECTEDVALUE('Expense Roll up Mapping'[Expense Layer 3]),
    "Production Labor", IF(ISBLANK(production),0, production), 
    "Associate Domestic Labor",  IF(ISBLANK(adl2-production), 0 ,adl2-production))&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, the result is the following:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I guess that in matrix, my Associate Domestic Labor row in expense layer 3 can't subtract different rows' values, production from the same table.&lt;/P&gt;&lt;P&gt;Is there any way that I can get this?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please advise.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you.&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Fri, 05 May 2023 20:14:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Subtract-a-top-row-value-to-another-row-from-Matrix/m-p/3222820#M157198</guid>
      <dc:creator>jasonjklim</dc:creator>
      <dc:date>2023-05-05T20:14:21Z</dc:date>
    </item>
  </channel>
</rss>

