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
My date slicer has Year and Month. How can I set it so that it defaults to 2024 Jan through Jun (Jun being the current month)?
Thanks
Solved! Go to Solution.
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
Vicky. I was just trying the "previous 45 days" and the "all" selections but it doesn't seem to be changes the selected date range.
Hi, @Anonymous
Thanks for @danextian @vicky_ reply. You can refer to their reply, if the ways are not meet your needs, you can refer to the following methods, set a flag to the slicer.
flag =
VAR _date =
SELECTEDVALUE ( 'Date'[Date] )
VAR _tag =
IF ( _date >= DATE ( 2024, 1, 1 ) && _date <= DATE ( 2024, 7, 1 ), 1, 0 )
RETURN
_tag
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
Yang, Your solution gave me this. This great for the default. How do I include additional months and years (greyed out) in the list to give the user aditional choices?
Hi, @Anonymous
If you are trying to show both selectable and non-selectable (grayed out) dates in Slicer, it is not supported in the current version. You can submit an idea for here and the product team will take note of such a need.
Related Link: New tab (powerbi.com)
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
Hi @Anonymous ,
The native visual doesnt have such a feature. You can try:
using relative date filter in the filter pane
Or the custom viz Date Picker (needs a license if used in the service)
YTD = IF(
'Calendar'[Date] <= EOMONTH(TODAY(), 0) && YEAR('Calendar'[Date]) = YEAR(TODAY()),
"YTD",
FORMAT('Calendar'[Date], "mmm yyyy") // replace this with whatever you want
)
I have a daily calendar, but the idea is the calculated column YTD in the 2nd column has a YTD value that can be used as a default value in your slicer.
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
This seems like what I'm attempting to do. However I'm a bit confused by how it works. Are you able to provide it in the format of 2024,01,02,03....
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |