Forum Discussion
Set date slicer to YTD
- Anonymous2 years ago
Hi, Anonymous
You can try to see if this method meets your needs.
Measure:Tag = VAR _date = SELECTEDVALUE ( 'Date'[Date] ) VAR _tag = IF ( _date >= DATE ( 2024, 1, 1 ) && _date <= DATE ( 2024, 7, 1 ), 1, 0 ) VAR _choice = SELECTEDVALUE( Choice[Choice] ) RETURN SWITCH( _choice, "DateFilter",_tag, "All Date",1 )Best Regards,
Yang
Community Support TeamIf there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!How to get your questions answered quickly -- How to provide sample data in the Power BI Forum
Is there a way to include Jan - Jun 2024 in the list? The user needs to be able to select any month if they don't want YTD.
Hi, Anonymous
You can try to see if this method meets your needs.
Measure:
Tag =
VAR _date =
SELECTEDVALUE ( 'Date'[Date] )
VAR _tag =
IF ( _date >= DATE ( 2024, 1, 1 ) && _date <= DATE ( 2024, 7, 1 ), 1, 0 )
VAR _choice =
SELECTEDVALUE( Choice[Choice] )
RETURN
SWITCH(
_choice,
"DateFilter",_tag,
"All Date",1
)
Best Regards,
Yang
Community Support Team
If there is any post helps, then please consider Accept it as the solution to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!
How to get your questions answered quickly -- How to provide sample data in the Power BI Forum