<?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: Show the Daily Difference for Each Item in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037707#M104057</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I tried to create date only column and time only column in order to show a visualization like below.&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;LI-CODE lang="markup"&gt;Expected result measure: =
VAR _currentlastvalue =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Time] = MAX ( 'Table'[Time] ) )
VAR _prevlasttime =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Item] = MAX ( 'Table'[Item] )
                &amp;amp;&amp;amp; 'Table'[Date] &amp;lt; MAX ( 'Table'[Date] )
        ),
        'Table'[Time]
    )
VAR _prevlastvalue =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Item] = MAX ( 'Table'[Item] )
                &amp;amp;&amp;amp; 'Table'[Date] &amp;lt; MAX ( 'Table'[Date] )
                &amp;amp;&amp;amp; 'Table'[Time] = _prevlasttime
        )
    )
RETURN
    IF (
        ISINSCOPE ( 'Table'[Date] ) &amp;amp;&amp;amp; ISINSCOPE ( 'Table'[Item] ),
        SWITCH (
            TRUE (),
            _prevlastvalue &amp;lt;&amp;gt; BLANK (), _currentlastvalue - _prevlastvalue,
            _prevlastvalue = BLANK (), 0
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 23 Jan 2023 12:44:01 GMT</pubDate>
    <dc:creator>Jihwan_Kim</dc:creator>
    <dc:date>2023-01-23T12:44:01Z</dc:date>
    <item>
      <title>Show the Daily Difference for Each Item</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037644#M104051</link>
      <description>&lt;P&gt;I've looked at other solutions here and none seem to be doing the trick.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;DateTime&lt;/TD&gt;&lt;TD&gt;Item&lt;/TD&gt;&lt;TD&gt;Value&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dec 1 9AM&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dec 1 10AM&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dec 2 9AM&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dec 2 11AM&lt;/TD&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Dec 3 12PM&lt;/TD&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So there's a few things going on here, but essentially, I need to show a graph that shows how much each Item has increased for each day.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;In this case, a clustered graph would show:&lt;BR /&gt;- Dec 1: 0 for Items A and B (as there's no previous date to report an increase from)&lt;BR /&gt;- Dec 2: 0 for A (as there are no entries for Item A for Dec 2) and 2 for Item B ( ([Dec 1 for B] = 3) minus ([last entry for Dec 2] = 5) = 2).&lt;BR /&gt;- Dec 3: 3 for A, and 0 for B using the same logic.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Let me know if you need any more details, but this seems extremely difficult given the research and solutions I've already tried.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you VERY much!&lt;BR /&gt;&lt;BR /&gt;Edit: This was poorly worded, so I tried to clean it up.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 12:27:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037644#M104051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-23T12:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Show the Daily Difference for Each Item</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037707#M104057</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I am not sure how your datamodel looks like, but please check the below picture and the attached pbix file.&lt;/P&gt;
&lt;P&gt;I tried to create date only column and time only column in order to show a visualization like below.&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;LI-CODE lang="markup"&gt;Expected result measure: =
VAR _currentlastvalue =
    CALCULATE ( SUM ( 'Table'[Value] ), 'Table'[Time] = MAX ( 'Table'[Time] ) )
VAR _prevlasttime =
    MAXX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Item] = MAX ( 'Table'[Item] )
                &amp;amp;&amp;amp; 'Table'[Date] &amp;lt; MAX ( 'Table'[Date] )
        ),
        'Table'[Time]
    )
VAR _prevlastvalue =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Item] = MAX ( 'Table'[Item] )
                &amp;amp;&amp;amp; 'Table'[Date] &amp;lt; MAX ( 'Table'[Date] )
                &amp;amp;&amp;amp; 'Table'[Time] = _prevlasttime
        )
    )
RETURN
    IF (
        ISINSCOPE ( 'Table'[Date] ) &amp;amp;&amp;amp; ISINSCOPE ( 'Table'[Item] ),
        SWITCH (
            TRUE (),
            _prevlastvalue &amp;lt;&amp;gt; BLANK (), _currentlastvalue - _prevlastvalue,
            _prevlastvalue = BLANK (), 0
        )
    )
&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 12:44:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037707#M104057</guid>
      <dc:creator>Jihwan_Kim</dc:creator>
      <dc:date>2023-01-23T12:44:01Z</dc:date>
    </item>
    <item>
      <title>Re: Show the Daily Difference for Each Item</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037732#M104062</link>
      <description>&lt;P&gt;Wow! This works! Thank you for this!&lt;BR /&gt;&lt;BR /&gt;There is one extra problem. I've got thousands of entries between December 22 and January 22 (31 days). So my graph is cramped and tiny. How can I make it so that it shows the results for the day, as well as the hour?&lt;/P&gt;</description>
      <pubDate>Mon, 23 Jan 2023 12:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Show-the-Daily-Difference-for-Each-Item/m-p/3037732#M104062</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-01-23T12:58:51Z</dc:date>
    </item>
  </channel>
</rss>

