Back

Explore Courses Blog Tutorials Interview Questions
0 votes
3 views
in BI by (11.1k points)

I have gone through various forms,and I failed to get a solution,I am trying to create a slicer which shows past 24 hours and 7 days 

I have tried but I got a timestamp which shows 

DD:MM:YYY HH:MM:SS PM/AM

So I have tried the following measures

minTime = 
var temp= NOW()
return
if(HOUR(temp)>=8,temp,DATE(YEAR(temp),MONTH(temp),DAY(temp)-1)+TIME(8,MINUTE(temp),SECOND(temp)))

 and Table Column

New Table= FILTER(ALL(TABLE),[Date]>=[minTime]&&[Date]<=Now())

Which gives me an error

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value. 

How can I solve this? 

1 Answer

0 votes
by (22.5k points)

1. Use a table as Slicer

 

5.jpg

 

2. Use this measure as visual filter

 

Last24Hour = IF(SELECTEDVALUE('Show Last 24  Hours'[Show Last 24 Hours],FALSE()),IF(DATEDIFF(SELECTEDVALUE('Table'[Time]),NOW(),HOUR)<=24  && SELECTEDVALUE('Table'[Time]) <= NOW(),1,-1),1)

6.jpg7.jpg

 


If u want to learn the tool in-depth, then come to us and sign up for this Power BI Certification    

Related questions

Browse Categories

...