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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Delphia
Advocate II
Advocate II

date slicers influence each other problem

Dear community,

I need your help with date slicers.

 

In my report I should have two types of date slicers:

  • predefined periods (overall, last week, last month, etc.) and
  • date range (to choose any date range that I want).

Delphia_0-1633009322932.png

How is it possible to automatically change "by default" values of the Date Range for the Last Month?

 

Thank you in advance!

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Delphia 

Power BI doesn't support you to set default range in slicer. You can set default range in your visual.

Here I build a sample to show you how to create visuals be imapcted by two slicers.

My Sample data is from 2021/08/01 to 2021/10/05.

I build two unrelated tables Date and Period to create slicers by Dax.

Date = 
CALENDAR(MIN('Table'[Date]),MAX('Table'[Date])) 
Period = {"Last Week","Overall","This Month"}

Then create a measure as below.

Filter =
VAR _LogicPeriod =
    SWITCH (
        SELECTEDVALUE ( Period[Value] ),
        "Overall", 1,
        "Last Week",
            IF ( SUM ( 'Table'[Weeknum] ) = WEEKNUM ( TODAY () ) - 1, 1, 0 ),
        "This Month", IF ( SUM ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 ),
        0
    )
VAR _DateRangeStart =
    MIN ( 'Date'[Date] )
VAR _DateRangeEnd =
    MAX ( 'Date'[Date] )
RETURN
    IF (
        ISFILTERED ( Period[Value] ),
        SWITCH (
            SELECTEDVALUE ( Period[Value] ),
            "Overall", 1,
            "Last Week",
                IF ( SUM ( 'Table'[Weeknum] ) = WEEKNUM ( TODAY () ) - 1, 1, 0 ),
            "This Month", IF ( SUM ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 ),
            0
        ),
        IF (
            ISFILTERED ( 'Date'[Date] ),
            IF (
                MAX ( 'Table'[Date] ) >= _DateRangeStart
                    && MAX ( 'Table'[Date] ) < _DateRangeEnd,
                1,
                0
            ),
            IF ( SUM ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 )
        )
    )

Create a visual ,add this measure into Filter Field in this visual and set it to show items when value =1.

Result is as below. 

By Default visual will show values in this month. 

1.png

Period slicer has higher level than Date slicer. Select Last week:

2.png

Select Overall:

3.png

If Period slicer is not selected, then we can filter the visual by range in Date slicer.

4.png

Best Regards,
Rico Zhou

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @Delphia 

Power BI doesn't support you to set default range in slicer. You can set default range in your visual.

Here I build a sample to show you how to create visuals be imapcted by two slicers.

My Sample data is from 2021/08/01 to 2021/10/05.

I build two unrelated tables Date and Period to create slicers by Dax.

Date = 
CALENDAR(MIN('Table'[Date]),MAX('Table'[Date])) 
Period = {"Last Week","Overall","This Month"}

Then create a measure as below.

Filter =
VAR _LogicPeriod =
    SWITCH (
        SELECTEDVALUE ( Period[Value] ),
        "Overall", 1,
        "Last Week",
            IF ( SUM ( 'Table'[Weeknum] ) = WEEKNUM ( TODAY () ) - 1, 1, 0 ),
        "This Month", IF ( SUM ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 ),
        0
    )
VAR _DateRangeStart =
    MIN ( 'Date'[Date] )
VAR _DateRangeEnd =
    MAX ( 'Date'[Date] )
RETURN
    IF (
        ISFILTERED ( Period[Value] ),
        SWITCH (
            SELECTEDVALUE ( Period[Value] ),
            "Overall", 1,
            "Last Week",
                IF ( SUM ( 'Table'[Weeknum] ) = WEEKNUM ( TODAY () ) - 1, 1, 0 ),
            "This Month", IF ( SUM ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 ),
            0
        ),
        IF (
            ISFILTERED ( 'Date'[Date] ),
            IF (
                MAX ( 'Table'[Date] ) >= _DateRangeStart
                    && MAX ( 'Table'[Date] ) < _DateRangeEnd,
                1,
                0
            ),
            IF ( SUM ( 'Table'[Month] ) = MONTH ( TODAY () ), 1, 0 )
        )
    )

Create a visual ,add this measure into Filter Field in this visual and set it to show items when value =1.

Result is as below. 

By Default visual will show values in this month. 

1.png

Period slicer has higher level than Date slicer. Select Last week:

2.png

Select Overall:

3.png

If Period slicer is not selected, then we can filter the visual by range in Date slicer.

4.png

Best Regards,
Rico Zhou

 

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

amitchandak
Super User
Super User

@Delphia , Default for range is not supported yet.

 

You need to have a column with that value and select that as the default

 


Month Type = Switch( True(),
eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
Format([Date],"MMM-YYYY")
)

 

 

refer if needed

Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=35

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.