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

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.

Reply
Anonymous
Not applicable

Default selected value in date slicer

I have a slicer that presents year-month (from my date table).

I want the slicer to be default filtered (selection) on the current month, but the user need to be able to select other months as well.

There is a column CurrentMonth (yes/no) in the date table that might help me?

5 REPLIES 5
v-luwang-msft
Community Support
Community Support

HI  @Anonymous ,

Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own better  solution to help others find it.

 

Best Regards
Lucien

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

By the  picture you provided,try the below steps:

vluwangmsft_0-1628760050910.png

Then  the Slicer Yearmon is not affected by Slicer mon.

 

And I think you could try the following soultion:

create a new measuere:

values2 = 
var test1=
    CALCULATE (
        MAX ( 'Table'[value] ),
        FILTER (  'Table' , month('Table'[date])=MONTH(NOW())-1&&YEAR('Table'[date])=YEAR(NOW()))
    ) var test2=
    CALCULATE (
        MAX ( 'Table'[value] ),
        FILTER (  'Table' , 'Table'[yearmon] = SELECTEDVALUE ( 'Table'[yearmon] ) )
    )
 return  IF( ISFILTERED( 'Table'[yearmon]) = True() , test2,test1)

then create visual ,the visual  default to last month's data when the slicer is not selected.

vluwangmsft_1-1628760231343.png

 

Wish it is helpful for you!

 

Best Regards

Lucien

Anonymous
Not applicable

Thanks, that will certainly work but there are many (more than 30) measures that needs to be adjusted.

selimovd
Super User
Super User

Hey @Anonymous ,

 

yes, you can add a calculated column that is checking for the current month. This you can activate as a slicer.

Check the following article on how to do that:

Automatically filter report on actual date with calculated column and with measure - What the fact.bi

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 
Anonymous
Not applicable

Not sure if it works

I have two slicers below, one for yearmonth and one for the IsPreviousMonth flag (see screenshot)

The values are in swedish (2021 juli means 2021 july and Ja/Nej means Yes/No).

 

When the IsPreviousMonth = yes is selected the YearMonth slicer is filtered but the value is not selected.

Apart from that I also want the user to see all values for YearMonth

 

joakimfe_0-1628658610380.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.