cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
CDSouthall
Regular Visitor

Filter on Single Date to display data between 2 dates.

Is it possible for me to build a Dax / funtionality that will allow me to have one date filter / slicer that will then return all rows between a start and end date range?

 

For example from the table below. If i select 01/02/2021 or 30/02/2021 it will show me rows for Event 3&4.

And if i selected 14/01/2021 it would show me Event 1, 2, 3 % 4.

 

CDSouthall_0-1614029874224.png

 

If anyone could assit me with this i would be most greatful indeed, i have tried everything i can think of with regards to this. 

1 REPLY 1
mahoneypat
Microsoft
Microsoft

You can use a measure pattern like this and use it as a filter on your table visual where it "is" 1

 

EventFilter =
VAR vSelDate =
    SELECTEDVALUE ( SlicerTable[Date] )
RETURN
    IF (
        ISBLANK (
            CALCULATE (
                COUNT ( Event[Event Name] ),
                Event[Start Date] <= vSelDate,
                Event[End Date] >= vSelDate
            )
        ),
        0,
        1
    )

 

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors
Top Kudoed Authors