Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.