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
truptis
Community Champion
Community Champion

Dynamically select date slicer

Hi All,

I wanted to select the dates dynamically depending upon which month it is.

I.e. - for example, currently it is March 2023 so in the date slicer historical dates till March 2023 must be selected.

 

@amitchandak @lbendlin 

3 REPLIES 3
lbendlin
Super User
Super User

As a super user you should stop using slicers. 🙂 Use the filter pane.

Thennarasu_R
Responsive Resident
Responsive Resident

Hi @truptis 

For current Month want move slicer automatically created one Calculated Column in that column you need to set one text Name like "Current Month " or Any other name is your Wish. we can achieve this way only .I'm Achieve .

Thennarasu_R_0-1678344710421.png

Month 1 = Var __Mon=FORMAT('Date'[Date],"mmm")
        var __Yr=FORMAT('Date'[Date],"YYYY")
Return
     Var _Result=
        IF(__Mon=FORMAT(TODAY(),"MMM"),IF(__Yr=FORMAT(TODAY(),"YYYY"),"Current Month",FORMAT('Date'[Date],"MMM")))
Return
IF(_Result=BLANK(),FORMAT('Date'[Date],"MMM"),_Result)
Thennarasu_R_2-1678345088108.png

@amitchandak 




If have helpful to you Give kudos and accepeted a solution.

Thanks,
Thennarasu 




andhiii079845
Solution Sage
Solution Sage

You can create a measure and filter your slicer with this measure: "IS NOT BLANK ()"
If you show "select all" in the options and set it active all shown dates are selected for default.

andhiii079845_0-1678344594734.png

 

filter = COUNTROWS(FILTER('date','date'[Date]<=TODAY()))

 

andhiii079845_0-1678345173857.png

andhiii079845_1-1678345192386.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.