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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Suryateza
Frequent Visitor

Slicer date range issue

Hi,

 

How can I show the dates before the slicer date selection? The Slicer date range is 7/1/2023-7/20/2023.

I want to show the arrival dates before 7/1, 

For example,

Customer A arrived on  6/29/2023 and departed on 7/06/2023. I want to show this record as his departure is 7/15, which still falls in our date range(7/1/2023-7/20/2023).

 

Can anybody help me with this please?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Suryateza ,

Please try below steps:

1. below is my test table
Table:

vbinbinyumsft_1-1690267222363.png

Date:

 

Date = CALENDAR(DATEVALUE("2023/07/01"),DATEVALUE("2023/07/20"))

 

vbinbinyumsft_0-1690267195747.png

2. create a measure with below dax formula

 

Measure =
VAR min_date =
    MIN ( 'Date'[Date] )
VAR max_date =
    MAX ( 'Date'[Date] )
VAR cur_arr =
    SELECTEDVALUE ( 'Table'[Arrived] )
VAR cur_dep =
    SELECTEDVALUE ( 'Table'[Departed] )
VAR result =
    SWITCH (
        TRUE (),
        cur_arr >= min_date
            && cur_dep <= max_date, 1,
        cur_arr < min_date
            && cur_dep >= min_date
            && cur_dep <= max_date, 1
    )
RETURN
    result

 

 

3. add a table visual with Table fields, add a slicer visual with Date table, add measure to table visual filter pane and apply

vbinbinyumsft_0-1690267548950.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
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 @Suryateza ,

Please try below steps:

1. below is my test table
Table:

vbinbinyumsft_1-1690267222363.png

Date:

 

Date = CALENDAR(DATEVALUE("2023/07/01"),DATEVALUE("2023/07/20"))

 

vbinbinyumsft_0-1690267195747.png

2. create a measure with below dax formula

 

Measure =
VAR min_date =
    MIN ( 'Date'[Date] )
VAR max_date =
    MAX ( 'Date'[Date] )
VAR cur_arr =
    SELECTEDVALUE ( 'Table'[Arrived] )
VAR cur_dep =
    SELECTEDVALUE ( 'Table'[Departed] )
VAR result =
    SWITCH (
        TRUE (),
        cur_arr >= min_date
            && cur_dep <= max_date, 1,
        cur_arr < min_date
            && cur_dep >= min_date
            && cur_dep <= max_date, 1
    )
RETURN
    result

 

 

3. add a table visual with Table fields, add a slicer visual with Date table, add measure to table visual filter pane and apply

vbinbinyumsft_0-1690267548950.gif

Please refer the attached .pbix file.

 

Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

SamInogic
Super User
Super User

Hi,


You can Try a different approach creating a new Table using the below DAX Expression,

 

DateRange = CALENDAR(MINA(Sampletable2[Arrived On]),MAXA(Sampletable2[Departed ON]))

 

You have to create the relationship between the date range table and your required table.

 

Please refer to the Below Screenshot,

 

SamInogic_0-1689848739550.png

Thanks!
Inogic Professional Services Division
Power Platform and Microsoft Dynamics 365 CRM Development – All under one roof!
Drop an email at crm@inogic.com
Services: http://www.inogic.com/services/
Power Platform/Dynamics 365 CRM Tips and Tricks: http://www.inogic.com/blog/
View solution in original post

 

 

Inogic Professional Services: Power Platform/Dynamics 365 CRM
An expert technical extension for your techno-functional business needs
Service: https://www.inogic.com/services/
Tips and Tricks: https://www.inogic.com/blog/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.