Forum Discussion
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
- AnonymousNot 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
- shishankiRegular Visitor
Also is it possible to write isfilter for date slicer?
- AnonymousNot 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 recordsselected on slicer
Regards,
Xiaoxin Sheng
- shishankiRegular Visitor
Thank you so much. would it be possible to give 1 example, as I am new to DAX function?