<?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 calculate the value between two date as max an min in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2305929#M57124</link>
    <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my problem:&lt;/P&gt;&lt;P&gt;I need to know the difference between two numbers based on the time. The first number is the first value recorded at the beginning of the day, the second number is the last value recorded at the end of the day.&lt;/P&gt;&lt;P&gt;Max-Min&amp;nbsp;does not work because during the day there may be lower values ​​than those recorded at the beginning of the day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2022 18:23:18 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2022-01-27T18:23:18Z</dc:date>
    <item>
      <title>calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2305929#M57124</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my problem:&lt;/P&gt;&lt;P&gt;I need to know the difference between two numbers based on the time. The first number is the first value recorded at the beginning of the day, the second number is the last value recorded at the end of the day.&lt;/P&gt;&lt;P&gt;Max-Min&amp;nbsp;does not work because during the day there may be lower values ​​than those recorded at the beginning of the day.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 18:23:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2305929#M57124</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-27T18:23:18Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2305962#M57127</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;Try something like this:&lt;BR /&gt;&lt;BR /&gt;var _cdate = DATE(YEAR(Table[Time]),MONTH(Table[Time]),DAY(Table[Time]))&lt;BR /&gt;var _minTime = Calculate(MIN(Table[Time]),ALL(Table),DATE(YEAR(Table[Time]),MONTH(Table[Time]),DAY(Table[Time]))=_cdate)&lt;BR /&gt;var _maxTime =&lt;BR /&gt;Calculate(MAX(Table[Time]),ALL(Table),DATE(YEAR(Table[Time]),MONTH(Table[Time]),DAY(Table[Time]))=_cdate)&lt;BR /&gt;var _maxvalue =Calculate(MAX(Table[Value]),ALL(Table),Table[Time]=_maxTime)&lt;BR /&gt;var _minvalue&amp;nbsp; =Calculate(MAX(Table[Value]),ALL(Table),Table[Time]=_minTime)&lt;BR /&gt;return&lt;BR /&gt;&lt;BR /&gt;_maxvalue-_minvalue&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 18:37:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2305962#M57127</guid>
      <dc:creator>ValtteriN</dc:creator>
      <dc:date>2022-01-27T18:37:41Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2306122#M57137</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;SPAN&gt;ValtteriN&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Its not working.&lt;/P&gt;&lt;P&gt;Here is an exemple of my table:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate 1860-1658.&lt;/P&gt;&lt;P&gt;This as to work every day. Any ideas?&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;FECHA&lt;/TD&gt;&lt;TD&gt;VALOR&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 00:01&lt;/TD&gt;&lt;TD&gt;1658&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 18:04&lt;/TD&gt;&lt;TD&gt;1826&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 18:43&lt;/TD&gt;&lt;TD&gt;1902&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 18:57&lt;/TD&gt;&lt;TD&gt;1861&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 19:55&lt;/TD&gt;&lt;TD&gt;1926&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 20:03&lt;/TD&gt;&lt;TD&gt;2002&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 20:13&lt;/TD&gt;&lt;TD&gt;2036&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 21:37&lt;/TD&gt;&lt;TD&gt;1912&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 21:45&lt;/TD&gt;&lt;TD&gt;1802&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 22:04&lt;/TD&gt;&lt;TD&gt;2098&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 22:16&lt;/TD&gt;&lt;TD&gt;2074&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 22:24&lt;/TD&gt;&lt;TD&gt;1940&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 22:41&lt;/TD&gt;&lt;TD&gt;1717&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 22:50&lt;/TD&gt;&lt;TD&gt;1675&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 22:58&lt;/TD&gt;&lt;TD&gt;1830&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 23:33&lt;/TD&gt;&lt;TD&gt;1734&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 23:40&lt;/TD&gt;&lt;TD&gt;1476&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;21/12/2021 23:58&lt;/TD&gt;&lt;TD&gt;1860&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 20:52:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2306122#M57137</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-27T20:52:19Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2306182#M57141</link>
      <description>&lt;P&gt;This is easier if you separate your FECHA column into a Date column and a Time column (which is &lt;A href="https://radacad.com/script-for-creating-time-table-in-power-bi-with-hours-minutes-and-seconds-buckets" target="_blank"&gt;good practice&lt;/A&gt; anyway).&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If you do this, then you should be able to write a measure like this:&lt;/P&gt;
&lt;LI-CODE lang="php"&gt;VAR Summary =
    ADDCOLUMNS (
        SUMMARIZE (
            Table1,
            Table1[Date],
            "MinTime", MIN ( Table1[Time] ),
            "MaxTime", MAX ( Table1[Time] )
        ),
        "MinVal", CALCULATE ( SUM ( Table1[VALOR] ), Table1[Time] = EARLIER ( [MinTime] ) ),
        "MaxVal", CALCULATE ( SUM ( Table1[VALOR] ), Table1[Time] = EARLIER ( [MaxTime] ) )
    )
RETURN
    SUMX ( Summary, [MaxVal] - [MinVal] )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2022 21:37:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2306182#M57141</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-27T21:37:30Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2308090#M57273</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;still not working...&lt;/P&gt;&lt;P&gt;maybe I explained it wrong.&lt;BR /&gt;For the example below, I look for the result of 706 (494.732-494026) obtained on day 20 for the variable 1047&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 16:22:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2308090#M57273</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-28T16:22:15Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2308105#M57276</link>
      <description>&lt;P&gt;Can you share the data in a format I can copy and paste from?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Jan 2022 16:28:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2308105#M57276</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-28T16:28:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2310760#M57427</link>
      <description>&lt;P&gt;Here's my pbix file:&lt;/P&gt;&lt;P&gt;&lt;A href="https://drive.google.com/file/d/1Lj4YbsCSRdvnL1oaU64fWoinFFemhdKs/view?usp=sharing" target="_self"&gt;PBIX File&lt;/A&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 13:02:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2310760#M57427</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-31T13:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2311288#M57444</link>
      <description>&lt;P&gt;It works fine for me after defining the date and time columns.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;You get zeros at the time granularity though since there is only one time in the filter context. This can be changed by removing that filter context.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 16:13:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2311288#M57444</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-31T16:13:25Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2311376#M57453</link>
      <description>&lt;P&gt;Can you send me the pbix file?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 16:53:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2311376#M57453</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2022-01-31T16:53:27Z</dc:date>
    </item>
    <item>
      <title>Re: calculate the value between two date as max an min</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2311429#M57456</link>
      <description>&lt;P&gt;Sure. See attached.&lt;/P&gt;</description>
      <pubDate>Mon, 31 Jan 2022 17:12:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/calculate-the-value-between-two-date-as-max-an-min/m-p/2311429#M57456</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2022-01-31T17:12:50Z</dc:date>
    </item>
  </channel>
</rss>

