Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
shishanki
Regular Visitor

Date silver and 24 hours data

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?

4 REPLIES 4
shishanki
Regular Visitor

Thank you so much. would it be possible to give 1 example, as I am new to DAX function?

Anonymous
Not applicable

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?

Anonymous
Not applicable

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 recordsLast 24 hour recordsselected on slicerselected on slicer

Regards,

Xiaoxin Sheng

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.