Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
I want to load power bi report with last 24 hours data. I am able to achieve that using measure but is it possible to also have date slicer for report so when report loads first time, user can view 24 hours data but later they can select date range also?
Any suggestions?
Thank you so much. would it be possible to give 1 example, as I am new to DAX function?
Hi @shishanki,
You can write a measure formula with ISFILTERED function to check the current filter selections and setting default condition of last 24 hours if no item selected to use on 'visual level filter'.
ISFILTERED function (DAX) - DAX | Microsoft Learn
Regards,
Xiaoxin Sheng
Also is it possible to write isfilter for date slicer?
Hi @shishanki,
Dax function not able to directly use on slicer, current you can only write a measure formula with custom expression and use on 'visual level filter' of specific visuals to apply custom filter effects.
Here is the measure formula with condition to check if any selection applies on your slicer or they will return last 24 hour records:
flag =
VAR currDate =
MAX ( 'Table'[Datetime] )
RETURN
IF (
ISFILTERED ( 'Table'[hour] ),
"Y",
IF ( AND ( currDate >= NOW () - 1, currDate <= NOW () ), "Y", "N" )
)
Last 24 hour records
selected on slicer
Regards,
Xiaoxin Sheng
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 4 | |
| 3 | |
| 2 | |
| 1 | |
| 1 |
| User | Count |
|---|---|
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 3 |