title: Power BI: Slicer for last 24 hours and 7 days
body: <p>Gone through various forums and other similar questions but none has worked for me!</p>
  
  <p>I got Timestamp column in this format: <code>DD:MM:YYY HH:MM:SS PM/AM</code></p>
  
  <p>So how do I create a calculated column that dynamically evaluates the last 24 hours from the refresh time of 8:00 AM daily morning (i.e., it should consider the last 24 hours from previous day 8:00 AM to refresh time 8:00 AM today.</p>
  
  <p>Likewise, the last 7 days too?</p>
  
  <p>I have tried following (for last 24 hours) which I got from <a href="https://community.powerbi.com/t5/Desktop/Only-show-last-24-hours-from-6am/td-p/109226" rel="nofollow noreferrer">https://community.powerbi.com/t5/Desktop/Only-show-last-24-hours-from-6am/td-p/109226</a><br>
  Power bi forum question.</p>
  
  <p>Measure: </p>
  
  <pre><code>minTime = 
  var temp= NOW()
  return
  if(HOUR(temp)&gt;=8,temp,DATE(YEAR(temp),MONTH(temp),DAY(temp)-1)+TIME(8,MINUTE(temp),SECOND(temp)))
  </code></pre>
  
  <p>Table column:</p>
  
  <pre><code>New Table= FILTER(ALL(TABLE),[Date]&gt;=[minTime]&amp;&amp;[Date]&lt;=Now())
  </code></pre>
  
  <p>But it is giving me an error as </p>
  
  <blockquote>
    <p>The expression refers to multiple columns. Multiple columns cannot be
    converted to a scalar value.</p>
  </blockquote>
  
  <p>Any help is much appreciated. </p>