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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
amaaiia
Super User
Super User

Issue trying to block the 'between' slicer through a measure

The goal of what I want to achieve is that when I select the 'last30days' option in the slicer, the calendar gets locked, and when I select 'custom', it gets activated. I am trying to achieve this with the following measure, which is set to 1 if I select the 'custom' option and to 0 if I select the 'last30days' option.

amaaiia_0-1737618944802.png

 I have this measure in the calendar filters as shown in the following image. The problem is that regardless of the option I select, the calendar gets deactivated. 

amaaiia_1-1737618955560.png

amaaiia_2-1737618959428.png

This happens with the 'between' type slicer; with the rest, it performs the action correctly, but I need it to work with the 'between'.

 

1 ACCEPTED SOLUTION
v-cgao-msft
Community Support
Community Support

Hi @amaaiia ,

 

By default, the interaction state between slicers is off. Please turn it on manually:

vcgaomsft_1-1737688886223.png

 

vcgaomsft_2-1737688926551.png

vcgaomsft_3-1737688940685.png

30days = 
VAR __min_date = MIN( 'Date'[Date] )
VAR __max_date = MAX( 'Date'[Date] )
VAR __today = TODAY ()
VAR __30_days_before = __today - 29
VAR __filter_tag =
    IF (
        ISBLANK ( SELECTEDVALUE ( CU_003_TRAZA_LAST30DAYS[tipo] ) )
            || SELECTEDVALUE ( CU_003_TRAZA_LAST30DAYS[tipo] ) = "custom",
        1,
        IF ( __min_date >= __30_days_before && __max_date <= __today, 1, 0 )
    )
RETURN
    __filter_tag

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
v-cgao-msft
Community Support
Community Support

Hi @amaaiia ,

 

By default, the interaction state between slicers is off. Please turn it on manually:

vcgaomsft_1-1737688886223.png

 

vcgaomsft_2-1737688926551.png

vcgaomsft_3-1737688940685.png

30days = 
VAR __min_date = MIN( 'Date'[Date] )
VAR __max_date = MAX( 'Date'[Date] )
VAR __today = TODAY ()
VAR __30_days_before = __today - 29
VAR __filter_tag =
    IF (
        ISBLANK ( SELECTEDVALUE ( CU_003_TRAZA_LAST30DAYS[tipo] ) )
            || SELECTEDVALUE ( CU_003_TRAZA_LAST30DAYS[tipo] ) = "custom",
        1,
        IF ( __min_date >= __30_days_before && __max_date <= __today, 1, 0 )
    )
RETURN
    __filter_tag

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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