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

See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap

Reply
tina345
Helper II
Helper II

Create a date slicer (slide) , based on what is selected on another Date_Type Slicer

Hi All,

   I have a data set with Sales and Delivery Date.I have added Screen Shot with data set  as well .My requirement is to have a date_type slicer(slicer_1) with sales and delivery date, based on what user select , I need to have another date_slider (Slicer_2).

  

    I created selected_value measure based on what is selected on date_type slicer , and was planning to create slicer_2 based on that measure, however it looks like I can't link that slicer with measure.

 

   Date_Type Slicer : Sales_Date and Delivery_Date

   Date Slider          : Another slicer based on what is selected above from Date_Type slicer

  m_Selected_Value = if(   SELECTEDVALUE(Sheet[DATA_FILTER])= "Sales_Date" , "Sales_Date", "Delivery_Date")

tina345_0-1713804246166.png

Data Set:

Product_IDRegionSales_DateDelivery_Date
100East1/1/20231/5/2023
100West2/3/20232/10/2023
200East3/2/20233/5/2025
300East3/15/20233/18/2023
400North4/1/20234/15/2023
500South5/1/20235/15/2023

 

  Thanks

  

1 ACCEPTED SOLUTION
Alex87
Super User
Super User

Hello,

First, you need a Date Table marked as Date and a slicer table with the two options (Sales Date/ Delivery Date = slicer 1)

Second, you need a DAX flag that you apply to the slicer 2 (coming from the Date table - I chose Month & Year but it can be changed to something else like day date etc)

Alex87_0-1713811677759.png

Alex87_2-1713811763050.png

The formula for the Flag is = 

Flag =
VAR __CurrentSelection = SELECTEDVALUE(Slicer[Slicer], "Sales Date")
VAR __Boolean =
IF(
    __CurrentSelection = "Sales Date",
    NOT(ISBLANK(
        CALCULATE(
            MAX('Data'[Sales_Date]),
            ALL('Dates'),
            'Data'[Sales_Date] IN VALUES('Dates'[Date])
        )
    )),
    NOT(ISBLANK(
        CALCULATE(
            MAX('Data'[Delivery_Date]),
            ALL('Dates'),
            'Data'[Delivery_Date]  IN VALUES('Dates'[Date])
        )
    ))
)
VAR __Result = IF(__Boolean, 1, 0)

RETURN
__Result
 
Is this asnwering your question? If so, please mark it as a solution
 
Best regards,
Alex Badiu

 

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




View solution in original post

1 REPLY 1
Alex87
Super User
Super User

Hello,

First, you need a Date Table marked as Date and a slicer table with the two options (Sales Date/ Delivery Date = slicer 1)

Second, you need a DAX flag that you apply to the slicer 2 (coming from the Date table - I chose Month & Year but it can be changed to something else like day date etc)

Alex87_0-1713811677759.png

Alex87_2-1713811763050.png

The formula for the Flag is = 

Flag =
VAR __CurrentSelection = SELECTEDVALUE(Slicer[Slicer], "Sales Date")
VAR __Boolean =
IF(
    __CurrentSelection = "Sales Date",
    NOT(ISBLANK(
        CALCULATE(
            MAX('Data'[Sales_Date]),
            ALL('Dates'),
            'Data'[Sales_Date] IN VALUES('Dates'[Date])
        )
    )),
    NOT(ISBLANK(
        CALCULATE(
            MAX('Data'[Delivery_Date]),
            ALL('Dates'),
            'Data'[Delivery_Date]  IN VALUES('Dates'[Date])
        )
    ))
)
VAR __Result = IF(__Boolean, 1, 0)

RETURN
__Result
 
Is this asnwering your question? If so, please mark it as a solution
 
Best regards,
Alex Badiu

 

 




Did I answer your question? Mark my post as a solution!
Appreciate your Like/Kudos

Proud to be a Super User!




Helpful resources

Announcements
May PBI 25 Carousel

Power BI Monthly Update - May 2025

Check out the May 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

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