Forum Discussion
filter where date = today
- Anonymous4 years ago
Hi Anonymous
I think calculated column is not a good way to achieve your goal. You can try to build a filter measure.
My Sample:
Firstly, let's build a new table to create a slicer.
Table = {"All","Today"}Then create a measure.
Filter = VAR _CurrentDateTime = MAX ( 'QR Scanning'[DateTime] ) RETURN SWITCH ( SELECTEDVALUE ( 'Table'[Slicer] ), "All", 1, "Today", IF ( DATE ( YEAR ( _CurrentDateTime ), MONTH ( _CurrentDateTime ), DAY ( _CurrentDateTime ) ) = TODAY (), 1, 0 ), 0 )Build your visual and add this measure into filter field. Set this measure to show items when value equal to 1.
Select ALL
Select Today.
Best Regards,
Rico ZhouIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
the buttons are ok as they are, my issue is the data the All returns
as it is tied to the query -
Hi Anonymous
I think calculated column is not a good way to achieve your goal. You can try to build a filter measure.
My Sample:
Firstly, let's build a new table to create a slicer.
Table = {"All","Today"}
Then create a measure.
Filter =
VAR _CurrentDateTime =
MAX ( 'QR Scanning'[DateTime] )
RETURN
SWITCH (
SELECTEDVALUE ( 'Table'[Slicer] ),
"All", 1,
"Today",
IF (
DATE ( YEAR ( _CurrentDateTime ), MONTH ( _CurrentDateTime ), DAY ( _CurrentDateTime ) )
= TODAY (),
1,
0
),
0
)
Build your visual and add this measure into filter field. Set this measure to show items when value equal to 1.
Select ALL
Select Today.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.