<?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: Date and Time Filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2810003#M88941</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424505" data-lia-user-login="amandabus21" class="lia-mention lia-mention-user"&gt;amandabus21&lt;/a&gt;&amp;nbsp;As a table. In Report view in the Desktop, choose the Modeling tab and then New table and paste in that formula.&lt;/P&gt;</description>
    <pubDate>Sat, 01 Oct 2022 12:35:29 GMT</pubDate>
    <dc:creator>Greg_Deckler</dc:creator>
    <dc:date>2022-10-01T12:35:29Z</dc:date>
    <item>
      <title>Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2809303#M88811</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Im having trouble filtering between a certain range of dates, and then after, filtering a certain range of hours.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I need all the incidents from 3/1/22 and 9/30/22. (That I can do with the sclicer)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Next, I need incidents only from 6:00 PM - 7:00AM between 3/1/22 - 9/30/22.&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;Thank you!&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 20:25:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2809303#M88811</guid>
      <dc:creator>amandabus21</dc:creator>
      <dc:date>2022-09-30T20:25:20Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2809352#M88815</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424505" data-lia-user-login="amandabus21" class="lia-mention lia-mention-user"&gt;amandabus21&lt;/a&gt;&amp;nbsp;Construct a TimeTable for your Time slicer:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;HourTable = 
SELECTCOLUMNS(
    ADDCOLUMNS(
        GENERATESERIES(1,24,1),
        "Hour",TIME([Value],0,0)
    ),
    "Hour",[Hour]
)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Then create a &lt;A href="https://community.powerbi.com/t5/Quick-Measures-Gallery/The-Complex-Selector/m-p/1116633#M534" target="_self"&gt;Complex Selector&lt;/A&gt; like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Time Selector Measure =
  VAR __Opened = MAX('Table'[Date Opened])
  VAR __MaxTime = MAX('TimeTable'[Hour])
  VAR __MinTime = MIN('TimeTable'[Hour])
  VAR __Time = __Opened - TRUNC(__Opened)
RETURN
  SWITCH(TRUE(),
    __Time &amp;gt;= __MaxTime, 1
    __Time &amp;lt;= __MinTime &amp;amp;&amp;amp; __Time &amp;gt;= 0, 1,
    0
  )&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 21:15:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2809352#M88815</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-09-30T21:15:02Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2809402#M88821</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;do i make the TimeTable as a column or a measure?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 30 Sep 2022 22:03:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2809402#M88821</guid>
      <dc:creator>amandabus21</dc:creator>
      <dc:date>2022-09-30T22:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2810003#M88941</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424505" data-lia-user-login="amandabus21" class="lia-mention lia-mention-user"&gt;amandabus21&lt;/a&gt;&amp;nbsp;As a table. In Report view in the Desktop, choose the Modeling tab and then New table and paste in that formula.&lt;/P&gt;</description>
      <pubDate>Sat, 01 Oct 2022 12:35:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2810003#M88941</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-10-01T12:35:29Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814418#M89191</link>
      <description>&lt;P&gt;Hi Greg, thanks for your help.&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I was able to create the table but now when I create the measure I am getting a syntax error.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 15:39:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814418#M89191</guid>
      <dc:creator>amandabus21</dc:creator>
      <dc:date>2022-10-03T15:39:23Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814477#M89195</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424505" data-lia-user-login="amandabus21" class="lia-mention lia-mention-user"&gt;amandabus21&lt;/a&gt;&amp;nbsp;Whoops, missed a comma after the first SWITCH condition:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Time Selector Measure =
  VAR __Opened = MAX('Table'[Date Opened])
  VAR __MaxTime = MAX('TimeTable'[Hour])
  VAR __MinTime = MIN('TimeTable'[Hour])
  VAR __Time = __Opened - TRUNC(__Opened)
RETURN
  SWITCH(TRUE(),
    __Time &amp;gt;= __MaxTime, 1,
    __Time &amp;lt;= __MinTime &amp;amp;&amp;amp; __Time &amp;gt;= 0, 1,
    0
  )&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 03 Oct 2022 16:01:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814477#M89195</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-10-03T16:01:00Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814494#M89197</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="313" data-lia-user-login="Greg_Deckler" class="lia-mention lia-mention-user"&gt;Greg_Deckler&lt;/a&gt;&amp;nbsp;thank you.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now how can I use that measure to filter the time between 6PM - 7AM?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Should I make a new column or is it supposed to be used a slicer?&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 16:05:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814494#M89197</guid>
      <dc:creator>amandabus21</dc:creator>
      <dc:date>2022-10-03T16:05:18Z</dc:date>
    </item>
    <item>
      <title>Re: Date and Time Filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814539#M89202</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="424505" data-lia-user-login="amandabus21" class="lia-mention lia-mention-user"&gt;amandabus21&lt;/a&gt;&amp;nbsp;Meant to be used in the Filters pane actually. The intent was to slice using your TimeTable. However, you may need two time tables, one to set a min and one to set a max. And, if you need to go from one day to the next (PM -&amp;gt; AM) then you will probably need to tweak the measure selector accordingly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 16:16:43 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Date-and-Time-Filters/m-p/2814539#M89202</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2022-10-03T16:16:43Z</dc:date>
    </item>
  </channel>
</rss>

