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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
v-srekom
Microsoft Employee
Microsoft Employee

Filter should be automatically selected based on current month

Hi,

 

I have a Year, Quarter and Month Hierarchy in a filter and the report data will change based on the selected filter. Now, I want to show the report based on current Month on the initial load of report.

For example, if we are in August, it should select the months till August by default. Whenever we load the report intially, it should select July & August. And on 1st september, July, August & September need to be automatically selected.

 

Could someone help me over this?

Slicer.PNG

 

Thanks in advance!

1 ACCEPTED SOLUTION

Hi @v-srekom ,

 

It is not supported for slicers to be selected by default while openning reports, unfortunately. But product group is looking into this feature. Please vote up the idea: https://ideas.powerbi.com/ideas/idea/?ideaid=39ba67cf-724e-4b6c-9906-51163749f759 to get it fixed quickly. For now, we just can show default values in visuals, like below. 

 

Workaround:

 

A disconnected date table:

 

Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

 

Measures:

 

Total sales = SUM('Table'[Sales])
Measure =
VAR monthtoday =
    MONTH ( TODAY () )
VAR yeartoday =
    YEAR ( TODAY () )
VAR selectedmonth =
    ALLSELECTED ( 'Date'[Date].[Month] )
VAR true_ =
    CALCULATE (
        [Total sales],
        FILTER (
            'Table',
            'Table'[Date].[Month] IN selectedmonth
                && 'Table'[Date].[Year] = MAX ( 'Date'[Date].[Year] )
        )
    )
VAR false_ =
    CALCULATE (
        [Total sales],
        FILTER (
            'Table',
            'Table'[Date].[MonthNo] = monthtoday
                && 'Table'[Date].[Year] = yeartoday
        )
    )
RETURN
    IF ( ISCROSSFILTERED ( 'Date'[Date].[Month] ), true_, false_ )

 

v-xuding-msft_0-1598587905626.png5.PNG

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

5 REPLIES 5
amitchandak
Super User
Super User

@v-srekom , Slicer can not be initialized on functions /rules, as of now.

You can create a column like this in your date table and select this qtr

 

qtr Type = Switch( True(),
[start qtr]<=Today() && [end qtr]>=Today(),"This Qtr" ,
[qtr Name]
)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AllisonKennedy
Super User
Super User

@v-srekom
Not sure I understand - do you only want Jul Aug when we're in August or should June be selected too?

Could you use a relative date slicer instead of the one in your image?

Other option is to add a filter on the slicer for DimDate[Date] and use a relative date filter on that to only show data in the last three months, and then the user can select which three months they want within that constraint.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

@AllisonKennedy 

First, I'll clear your confusion: As we are using fiscal year, teh cycle is from July to June of next year.

And just explaining the things more clearly:

1. We have budget values for future months/quarters. So, we need to show the future months in the slicer so that client can manually select future months.

2. Whatever the month we are in, all the months till current month need to be selected by default whenever we open the report

Hi @v-srekom ,

 

It is not supported for slicers to be selected by default while openning reports, unfortunately. But product group is looking into this feature. Please vote up the idea: https://ideas.powerbi.com/ideas/idea/?ideaid=39ba67cf-724e-4b6c-9906-51163749f759 to get it fixed quickly. For now, we just can show default values in visuals, like below. 

 

Workaround:

 

A disconnected date table:

 

Date = CALENDAR(MIN('Table'[Date]),MAX('Table'[Date]))

 

Measures:

 

Total sales = SUM('Table'[Sales])
Measure =
VAR monthtoday =
    MONTH ( TODAY () )
VAR yeartoday =
    YEAR ( TODAY () )
VAR selectedmonth =
    ALLSELECTED ( 'Date'[Date].[Month] )
VAR true_ =
    CALCULATE (
        [Total sales],
        FILTER (
            'Table',
            'Table'[Date].[Month] IN selectedmonth
                && 'Table'[Date].[Year] = MAX ( 'Date'[Date].[Year] )
        )
    )
VAR false_ =
    CALCULATE (
        [Total sales],
        FILTER (
            'Table',
            'Table'[Date].[MonthNo] = monthtoday
                && 'Table'[Date].[Year] = yeartoday
        )
    )
RETURN
    IF ( ISCROSSFILTERED ( 'Date'[Date].[Month] ), true_, false_ )

 

v-xuding-msft_0-1598587905626.png5.PNG

 

 

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-srekom
That's a bit more clear now. 🙂

I feel like it should be possible if you get creative enough, but it won't provide the exact results you're looking for. The solution I am thinking would be similar to this:
https://www.youtube.com/watch?v=FO6e3rjSslQ

Except using Date and TODAY() instead of formatting/changing decimals.

Otherwise the report will save with the slicer selections you have selected when you save, so as a last resort you could do a manual update each month.

Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

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.