Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Instead of filtering Data from yesterday's date, is it possible to filter from the last 24 hours? I have a date column with hours mins and seconds and would like to filter/slice data by hour if possible.
Solved! Go to Solution.
Hi @Anonymous ,
We can use the following workaround to filter the last 24 hours in some visual:
1. create a table as slicer:
2. create a measure and use it in 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)
Best regards,
Hi @Anonymous ,
How about the result after you follow the suggestions mentioned in my original post?Could you please provide more details about it If it doesn't meet your requirement?
Best regards,
Hi @Anonymous ,
We can use the following workaround to filter the last 24 hours in some visual:
1. create a table as slicer:
2. create a measure and use it in 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)
Best regards,
The answer is "Probably" but the trickiness will be how real-time you would like it.
One method can be to add a "Last 24 hours" flag into your table (Yes/No Field), based on DateTime.LocalNow(). You could do data math to check if the datetime is between DateTime.LocalNow() and DateTime.LocalNow() minus 1 day. This will only show you "last 24 hours at the time of refresh". This might be what you want.
User | Count |
---|---|
102 | |
92 | |
85 | |
78 | |
71 |
User | Count |
---|---|
113 | |
104 | |
101 | |
73 | |
65 |