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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
Super User
Super User

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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