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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
tomperro
Helper V
Helper V

Help with Filtering Multiple Date Columns Using Start and End Date

First time poster.

I have a table that has multiple start and end dates that I need to filter based on a date slicer.

If I select 01/2022 as my slicer, I need to filter each start and end date as follows...

 

if ( End Date>=01/01/2022 Or (End Date Is Null AND Start Date]<=01/01/2022)

 

Expected Results

DepartmentDivisionImplementation ZoneCategory IDTarget
TransportationNew YorkNYP115
ElectricalPhiladelphiaPHL212
     

 

MonthlyTargetTable

DepartmentDepartment Start DateDepartment End DateDivisionDivision Start DateDivision End DateImplementation ZoneImplementation Zone Start DateImplementation Zone End DateCategory IDTarget
Transportation01/01/2022 New York01/01/2022 NYP01/01/2022 110
Transportation01/01/2022 New York01/01/2022 NYP01/01/2022 15
Electrical01/01/202203/01/2022Philadelphia01/01/2022 PHL01/01/2022 212
Mechanical02/01/2022 Philadelphia01/01/2022 PHL01/01/2022 35
           

 

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

Hi @tomperro ,

According to your description, here's my solution.

Not sure if you have a date table as slicer, if not, create one.

vkalyjmsft_0-1658489271614.png

Then create a measure.

Check =
VAR _S =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    IF (
        IF (
            MAX ( 'MonthlyTarget'[Department End Date] ) <> BLANK (),
            MAX ( 'MonthlyTarget'[Department End Date] ) >= _S,
            MAX ( 'MonthlyTarget'[Department Start Date] ) <= _S
        )
            && IF (
                MAX ( 'MonthlyTarget'[Division End Date] ) <> BLANK (),
                MAX ( 'MonthlyTarget'[Division End Date] ) >= _S,
                MAX ( 'MonthlyTarget'[Division Start Date] ) <= _S
            )
            && IF (
                MAX ( 'MonthlyTarget'[Implementation Zone End Date] ) <> BLANK (),
                MAX ( 'MonthlyTarget'[Implementation Zone End Date] ) >= _S,
                MAX ( 'MonthlyTarget'[Implementation Zone Start Date] ) <= _S
            ),
        1,
        0
    )

Put the measure in the visual and let it's value to 1. Get the result.

vkalyjmsft_1-1658489522268.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

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
v-yanjiang-msft
Community Support
Community Support

Hi @tomperro ,

According to your description, here's my solution.

Not sure if you have a date table as slicer, if not, create one.

vkalyjmsft_0-1658489271614.png

Then create a measure.

Check =
VAR _S =
    SELECTEDVALUE ( 'Date'[Date] )
RETURN
    IF (
        IF (
            MAX ( 'MonthlyTarget'[Department End Date] ) <> BLANK (),
            MAX ( 'MonthlyTarget'[Department End Date] ) >= _S,
            MAX ( 'MonthlyTarget'[Department Start Date] ) <= _S
        )
            && IF (
                MAX ( 'MonthlyTarget'[Division End Date] ) <> BLANK (),
                MAX ( 'MonthlyTarget'[Division End Date] ) >= _S,
                MAX ( 'MonthlyTarget'[Division Start Date] ) <= _S
            )
            && IF (
                MAX ( 'MonthlyTarget'[Implementation Zone End Date] ) <> BLANK (),
                MAX ( 'MonthlyTarget'[Implementation Zone End Date] ) >= _S,
                MAX ( 'MonthlyTarget'[Implementation Zone Start Date] ) <= _S
            ),
        1,
        0
    )

Put the measure in the visual and let it's value to 1. Get the result.

vkalyjmsft_1-1658489522268.png

I attach my sample below for reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@tomperro , refer if one these two blogs can help

https://community.powerbi.com/t5/Community-Blog/HR-Analytics-Active-Employee-Hire-and-Termination-tr...

https://community.powerbi.com/t5/Community-Blog/How-to-divide-distribute-values-between-start-date-o...

 

Or the attached file can help

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Top Solution Authors