<?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: How To DataTime Range Slicer in Data Stories Gallery</title>
    <link>https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/How-To-DataTime-Range-Slicer/m-p/464691#M2095</link>
    <description>&lt;P&gt;&lt;A title="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/35089" target="_blank"&gt;@stretcharm&lt;/A&gt;&amp;nbsp;Do you think your work around would work for just a time filter. My date already has a slicer that works well. I now just need to implement your method on my time values. The values are in hh:mm format which I changed into time format. I think then I will only need to use decimals is that correct?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Amirreza&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Jul 2018 13:35:30 GMT</pubDate>
    <dc:creator>AmirReza</dc:creator>
    <dc:date>2018-07-18T13:35:30Z</dc:date>
    <item>
      <title>How To DataTime Range Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/How-To-DataTime-Range-Slicer/m-p/306357#M1255</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;In response to a Forum post here is my solution for adding a Date Time Range Slicer. It's not great but I've not found a better solution with the current version&amp;nbsp; (Nov17)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;The best I've got is using What If Parameters, using decimal parameters as a Datetime is stored as a decimal value with whole numbers being days and the decimals for the time.&lt;/P&gt;
&lt;P&gt;&amp;nbsp; &lt;/P&gt;
&lt;P&gt;There is no what if for date time so you have to use decimal&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can then edit the definition from&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;FromDateTime = GENERATESERIES(1, 20, 0.1)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;To somethat that has range related to your data.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;FromDateTime = GENERATESERIES(INT(MIN(Data[StartDateTime])), INT(MAX(Data[EndDateTime]))+1, 0.01)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can also set the default dymanically&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;ToDateTime Value = SELECTEDVALUE(ToDateTime[ToDateTime], INT(TODAY())-1)&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Create a new Computed Column to show the date time version&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;SelectedToDateTime = [ToDateTime Value]&lt;/PRE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Change this in modelling to a datetime with your preferred format. You can put this next to the slicer which is still show just a decimal value.&lt;/P&gt;
&lt;P&gt;Sliding the slicer will update the value, but you've got to do a bit of trial and error to get the value you need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Do the same for the ToDateTime&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now in the data set add a new Measure to check if the records are in the range specified by the slicers&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;PRE&gt;IsInRange = if(min(Data[StartDateTime])&amp;gt;=FromDateTime[FromDateTime Value] &amp;amp;&amp;amp; Max(Data[EndDateTime])&amp;lt;=ToDateTime[ToDateTime Value],1,0)&lt;/PRE&gt;
&lt;P&gt;&lt;LI-WRAPPER&gt;&lt;/LI-WRAPPER&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Finally add a filter to your visualisations or the page to only include values where IsInRange is 1&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Its tricky to get the granualrity right for the time and slicers dont work well with large date ranges.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN class="reportid hidden"&gt;eyJrIjoiNmQ4MTdjN2UtZTdmYy00ZDRiLTgzNWUtOWNmNzgwOWQ4OTljIiwidCI6ImRkYmM2NDllLWJlMzEtNDRiOC05MzlkLTVjMGFmNGRiOTNiNSIsImMiOjh9&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 19 Nov 2017 20:43:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/How-To-DataTime-Range-Slicer/m-p/306357#M1255</guid>
      <dc:creator>stretcharm</dc:creator>
      <dc:date>2017-11-19T20:43:46Z</dc:date>
    </item>
    <item>
      <title>Re: How To DataTime Range Slicer</title>
      <link>https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/How-To-DataTime-Range-Slicer/m-p/464691#M2095</link>
      <description>&lt;P&gt;&lt;A title="" href="https://community.powerbi.com/t5/user/viewprofilepage/user-id/35089" target="_blank"&gt;@stretcharm&lt;/A&gt;&amp;nbsp;Do you think your work around would work for just a time filter. My date already has a slicer that works well. I now just need to implement your method on my time values. The values are in hh:mm format which I changed into time format. I think then I will only need to use decimals is that correct?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Any help would be greatly appreciated.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks,&lt;/P&gt;
&lt;P&gt;Amirreza&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Jul 2018 13:35:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Data-Stories-Gallery/How-To-DataTime-Range-Slicer/m-p/464691#M2095</guid>
      <dc:creator>AmirReza</dc:creator>
      <dc:date>2018-07-18T13:35:30Z</dc:date>
    </item>
  </channel>
</rss>

