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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.