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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Anonymous
Not applicable

Filter data by date range

I have some flow data from a stream and also a list of reservoir events (that have start and end dates). Say I click on Event 1 (start date 1/1/2011, end date 1/6/2011), how do I set up that relationship so that the it zooms to that date range whenever I click on an event? I can't seem to manage the relationship so that it goes to the entire range, instead it just goes to the start or end date.

 

 

 

 

 

snip1.JPGsnip2.JPG

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

You may create a date table and then create the measure like below.Attached sample file for your reference.

Date = CALENDARAUTO( )
Event = 
VAR currentDate =
    MAX ( 'Date'[Date] )
RETURN
    CALCULATE (
        MAX(Table1[Event]),
        FILTER (
            Table1,
            ( Table1[Start Date] <= currentDate
                && Table1[End Date] >= currentDate )
        )
    )

1.png

Regards,

Community Support Team _ Cherie Chen
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

1 REPLY 1
v-cherch-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous 

You may create a date table and then create the measure like below.Attached sample file for your reference.

Date = CALENDARAUTO( )
Event = 
VAR currentDate =
    MAX ( 'Date'[Date] )
RETURN
    CALCULATE (
        MAX(Table1[Event]),
        FILTER (
            Table1,
            ( Table1[Start Date] <= currentDate
                && Table1[End Date] >= currentDate )
        )
    )

1.png

Regards,

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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors