<?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: DATEDIFF With Month Filter in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232631#M20144</link>
    <description>It's not clear at all what you want to do... "respect the hour limit of the month" - please define what you mean by this.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
    <pubDate>Sat, 18 Jul 2020 16:47:49 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-07-18T16:47:49Z</dc:date>
    <item>
      <title>DATEDIFF With Month Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1231927#M20119</link>
      <description>&lt;P&gt;Hello my colleagues!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;My problem is:&lt;/STRONG&gt; &lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need to calculate the &lt;EM&gt;&lt;STRONG&gt;time difference between dates&lt;/STRONG&gt;&lt;/EM&gt;, starting at &lt;STRONG&gt;&lt;EM&gt;06/01/2020&lt;/EM&gt;&lt;/STRONG&gt; and ending at &lt;EM&gt;"&lt;STRONG&gt;NOW&lt;/STRONG&gt;"&lt;/EM&gt;. However, I need this calculation to respect the hour limit of the month, but also be cumulative.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;How i'm calculating now:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Currently, my &lt;STRONG&gt;equation&lt;/STRONG&gt; is as follows:&lt;/P&gt;&lt;LI-SPOILER&gt;TimeNow = DATEDIFF (DATE (2020,06,01), NOW (), HOUR)&lt;/LI-SPOILER&gt;&lt;P&gt;&lt;U&gt;&lt;STRONG&gt;The problem in this formula is:&lt;/STRONG&gt;&lt;/U&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need every month that passes, those hours &lt;STRONG&gt;accumulate since 06/01/2020&lt;/STRONG&gt;, but &lt;STRONG&gt;stop at the end of the month&lt;/STRONG&gt; where there was a &lt;STRONG&gt;maintenance register&lt;/STRONG&gt;.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My formula will start at &lt;STRONG&gt;June&lt;/STRONG&gt;, and the difference in this month is only from &lt;STRONG&gt;06/01/2020 to 06/30/2020&lt;/STRONG&gt;. However for &lt;STRONG&gt;July&lt;/STRONG&gt; that is cumulative, from &lt;STRONG&gt;06/01/2020 to 07/31/2020&lt;/STRONG&gt;, For &lt;STRONG&gt;August&lt;/STRONG&gt; from &lt;STRONG&gt;06/01/2020 to 08/31/2020&lt;/STRONG&gt; and so on.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;My database have the following data, and the DATEDIFF is what i want to create:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Equipment&lt;/TD&gt;&lt;TD&gt;Breakdown Start&lt;/TD&gt;&lt;TD&gt;Breakdown End&lt;/TD&gt;&lt;TD&gt;DATEDIFF to NOW (Hours)&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;03/06/2020 09:05:00&lt;/TD&gt;&lt;TD&gt;03/06/2020 15:00:00&lt;/TD&gt;&lt;TD&gt;730&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;15/06/2020 10:15:00&lt;/TD&gt;&lt;TD&gt;15/06/2020 12:00:00&lt;/TD&gt;&lt;TD&gt;730&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;08/07/2020 12:00:00&lt;/TD&gt;&lt;TD&gt;08/07/2020 13:00:00&lt;/TD&gt;&lt;TD&gt;1185 (Max is 1460, two months)&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;How can i solve this question? Can be in DAX or Query.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks for the help!&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 13:12:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1231927#M20119</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T13:12:51Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF With Month Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232134#M20124</link>
      <description>&lt;P&gt;What do you mean by "hour limit of the month"?&amp;nbsp; Can you provide example data table and desired output, so a solution can be suggested?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regards,&lt;/P&gt;&lt;P&gt;Pat&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 17 Jul 2020 22:49:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232134#M20124</guid>
      <dc:creator>mahoneypat</dc:creator>
      <dc:date>2020-07-17T22:49:00Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF With Month Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232238#M20129</link>
      <description>&lt;P&gt;Here is a general pattern for running total calculations:&lt;/P&gt;&lt;LI-CODE lang="php"&gt;Running Total = 
VAR MaxDateInFilterContext =
    MAX ( Dates[Date] )
VAR MaxYear =
    YEAR ( MaxDateInFilterContext )
VAR DatesLessThanMaxDate =
    FILTER (
        ALL ( Dates[Date], Dates[Calendar Year Number] ),
        Dates[Date] &amp;lt;= MaxDateInFilterContext
            &amp;amp;&amp;amp; Dates[Calendar Year Number] = MaxYear
    )
VAR Result =
    CALCULATE (
        [Total Sales],
        DatesLessThanMaxDate
    )
RETURN
    Result&lt;/LI-CODE&gt;</description>
      <pubDate>Sat, 18 Jul 2020 04:58:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232238#M20129</guid>
      <dc:creator>AntrikshSharma</dc:creator>
      <dc:date>2020-07-18T04:58:04Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF With Month Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232631#M20144</link>
      <description>It's not clear at all what you want to do... "respect the hour limit of the month" - please define what you mean by this.&lt;BR /&gt;&lt;BR /&gt;Best&lt;BR /&gt;D</description>
      <pubDate>Sat, 18 Jul 2020 16:47:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1232631#M20144</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-18T16:47:49Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF With Month Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1235185#M20203</link>
      <description>&lt;P&gt;Hello my friend, post edited with the data table example.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 13:14:01 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1235185#M20203</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T13:14:01Z</dc:date>
    </item>
    <item>
      <title>Re: DATEDIFF With Month Filter</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1236000#M20217</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;SPAN&gt;Antriksh Sharma!&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Could you explain me the steps of this calculation?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 20 Jul 2020 18:04:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DATEDIFF-With-Month-Filter/m-p/1236000#M20217</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-20T18:04:08Z</dc:date>
    </item>
  </channel>
</rss>

