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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Join two slicers in the same page

I want to join two slicers in the same page. I have a table with column 'date' and I have in another table a column 'slicer_date'. First column has dates like '20/12/2018' and column 'slicer_date' has 'L3M', 'L9M'...

I have one slicer with ( 'L3M', 'L9M','LY'...) and another slicer with two exact dates(range of dates). 

 

I want that when I select L3M(Last three months) the second slicer represent the exact dates that the first slicer choose. 

For example, if I choose L3M, the second slicer automaticaly represent From: 1/10/2021 to: 31/12/2021.

 

Is it possible? Thanks.

1 ACCEPTED SOLUTION
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Measure:

Measure =
VAR _1 =
    TODAY ()
VAR _Startdate =
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( slicer_date[slicer_date] ) = "L3M", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 4, 1 ),
        SELECTEDVALUE ( slicer_date[slicer_date] ) = "L6M", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 7, 1 ),
        SELECTEDVALUE ( slicer_date[slicer_date] ) = "L9M", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 10, 1 )
    )
VAR _Enddate =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ) - 1
RETURN
    IF (
        SELECTEDVALUE ( 'Date'[Date] ) >= _Startdate
            && SELECTEDVALUE ( 'Date'[Date] ) <= _Enddate,
        1,
        0
    )

 Create a slicer based on the Date table. Put Measure into Filters, set to equal 1.

vzhangti_1-1641975157166.pngvzhangti_2-1641975180220.png

Does this match your desired outcome?

 

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
v-zhangti
Community Support
Community Support

Hi, @Anonymous 

 

You can try the following methods.

Measure:

Measure =
VAR _1 =
    TODAY ()
VAR _Startdate =
    SWITCH (
        TRUE (),
        SELECTEDVALUE ( slicer_date[slicer_date] ) = "L3M", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 4, 1 ),
        SELECTEDVALUE ( slicer_date[slicer_date] ) = "L6M", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 7, 1 ),
        SELECTEDVALUE ( slicer_date[slicer_date] ) = "L9M", DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ) - 10, 1 )
    )
VAR _Enddate =
    DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 1 ) - 1
RETURN
    IF (
        SELECTEDVALUE ( 'Date'[Date] ) >= _Startdate
            && SELECTEDVALUE ( 'Date'[Date] ) <= _Enddate,
        1,
        0
    )

 Create a slicer based on the Date table. Put Measure into Filters, set to equal 1.

vzhangti_1-1641975157166.pngvzhangti_2-1641975180220.png

Does this match your desired outcome?

 

Best Regards,

Community Support Team _Charlotte

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

VahidDM
Super User
Super User

Hi @Anonymous 

 

IF you choose L6M the second slicer shows 1/10/2021 to: 31/12/2021 or 1/6/2021 to: 31/12/2021??

 


Appreciate your Kudos!!
LinkedIn: 
www.linkedin.com/in/vahid-dm/

 

 

Anonymous
Not applicable

Sorry, the second one. Edited!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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