<?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 Matrix with previous calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-with-previous-calculation/m-p/3304573#M123393</link>
    <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently working on a solution that needs to sum activities hours per user and makes a calculation based on static expected hour.&amp;nbsp;Basically, a user can work in different activities and will be expected see a subtotal subtracting from expected hour on a decreasing scale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, you can find a data sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;Jsilva&lt;/STRONG&gt;, I expected see on total column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#1 line - Hours -&amp;nbsp;Expected = 10 - 1 = &lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#2 line - Hours -&amp;nbsp;Expected = 9 (&lt;STRONG&gt;previous calculation&lt;/STRONG&gt;) - 3 = 6&lt;/P&gt;&lt;P&gt;#3 line - Hours -&amp;nbsp;Expected = 6 (&lt;STRONG&gt;previous calculation&lt;/STRONG&gt;) - 4 = 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do that?&lt;/P&gt;</description>
    <pubDate>Tue, 27 Jun 2023 14:51:18 GMT</pubDate>
    <dc:creator>Johonnatan</dc:creator>
    <dc:date>2023-06-27T14:51:18Z</dc:date>
    <item>
      <title>Matrix with previous calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-with-previous-calculation/m-p/3304573#M123393</link>
      <description>&lt;P&gt;Hi there&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am currently working on a solution that needs to sum activities hours per user and makes a calculation based on static expected hour.&amp;nbsp;Basically, a user can work in different activities and will be expected see a subtotal subtracting from expected hour on a decreasing scale.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;In this example, you can find a data sample.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;For &lt;STRONG&gt;Jsilva&lt;/STRONG&gt;, I expected see on total column:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;#1 line - Hours -&amp;nbsp;Expected = 10 - 1 = &lt;STRONG&gt;9&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;#2 line - Hours -&amp;nbsp;Expected = 9 (&lt;STRONG&gt;previous calculation&lt;/STRONG&gt;) - 3 = 6&lt;/P&gt;&lt;P&gt;#3 line - Hours -&amp;nbsp;Expected = 6 (&lt;STRONG&gt;previous calculation&lt;/STRONG&gt;) - 4 = 2&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there a way to do that?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Jun 2023 14:51:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-with-previous-calculation/m-p/3304573#M123393</guid>
      <dc:creator>Johonnatan</dc:creator>
      <dc:date>2023-06-27T14:51:18Z</dc:date>
    </item>
    <item>
      <title>Re: Matrix with previous calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-with-previous-calculation/m-p/3307324#M123536</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="331302" data-lia-user-login="Johonnatan" class="lia-mention lia-mention-user"&gt;Johonnatan&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try:&lt;/P&gt;
&lt;P&gt;First create an index column:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Then apply the measure:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = SELECTEDVALUE('Table'[Expected])-SUMX(FILTER(ALL('Table'),[Index]&amp;lt;=SELECTEDVALUE('Table'[Index])&amp;amp;&amp;amp;[User]=SELECTEDVALUE('Table'[User])),[Hours])&lt;/LI-CODE&gt;
&lt;P&gt;Final output:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Jianbo Li&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Jun 2023 03:18:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Matrix-with-previous-calculation/m-p/3307324#M123536</guid>
      <dc:creator>v-jianboli-msft</dc:creator>
      <dc:date>2023-06-29T03:18:26Z</dc:date>
    </item>
  </channel>
</rss>

