1. Use a table as Slicer
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)
If u want to learn the tool in-depth, then come to us and sign up for this Power BI Certification