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
paulaula81
New Member

Range of dates in a time slicer

Hi, I have a list of events with start date and end date.

 

I am using a time slicer to pick a range of dates. In timeslicer you can only put one value to display.

 

So if for example I have an event from June 4 to June 7 but I want to check from June 5 to June 7 the event won't get displayed because in the value of the slicer I was able to put only June 4.

 

Is there any other tool besides time slicer that can check ranges and not only one value?

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

Hi @paulaula81,

 

The Timeline slicer can be only put one column at the same time. To work around the issue, you can create another calendar table, then drag the date column from this calendar table to a slicer/timeline slicer visual. 

 

Create measures below: 

 

 

MinSelectedDate = 
VAR minselected =
    CALCULATE (
        Min ( 'calendar'[Date] )
        
    )
RETURN
    IF ( ISFILTERED ( 'calendar'[Date] ), minselected )

 

 

MaxSelectedDate = 
VAR maxselected =
    CALCULATE (
        MAX ( 'calendar'[Date] )
        
    )
RETURN
    IF ( ISFILTERED ( 'calendar'[Date] ), maxselected )

 

 

Measure = IF(MAX('Table1'[Start])>=[MinSelectedDate] && MAX('Table1'[End])<=[MaxSelectedDate] && MAX('Table1'[End])<>BLANK(),1,BLANK())

 

 q4.PNG

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun 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
Ashish_Mathur
Super User
Super User

Hi,

 

I'd suggest using the Query Editor to convert the two Date columns into a single Date column.  Then create a Calendar Table and build a relationship from the Date column of your source table to the Date column if your Calendar Table.  In your slicer visual, drag the Date from the Calendar Table.

 

To get more specific help, share some data and also show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
v-qiuyu-msft
Community Support
Community Support

Hi @paulaula81,

 

The Timeline slicer can be only put one column at the same time. To work around the issue, you can create another calendar table, then drag the date column from this calendar table to a slicer/timeline slicer visual. 

 

Create measures below: 

 

 

MinSelectedDate = 
VAR minselected =
    CALCULATE (
        Min ( 'calendar'[Date] )
        
    )
RETURN
    IF ( ISFILTERED ( 'calendar'[Date] ), minselected )

 

 

MaxSelectedDate = 
VAR maxselected =
    CALCULATE (
        MAX ( 'calendar'[Date] )
        
    )
RETURN
    IF ( ISFILTERED ( 'calendar'[Date] ), maxselected )

 

 

Measure = IF(MAX('Table1'[Start])>=[MinSelectedDate] && MAX('Table1'[End])<=[MaxSelectedDate] && MAX('Table1'[End])<>BLANK(),1,BLANK())

 

 q4.PNG

 

Best Regards,
Qiuyun Yu

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

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.