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
wacook
Frequent Visitor

Live During Date Filter

I am trying to figure out how to create a date filter that will work for my data. We have policies that go live and expire on certain days, so we like to see deals that are live during certain periods. For instance, we compare all policies that were live in Q3 '22 vs all policies that were live Q3 '21. It is quite simple, all deals that expire after September 30 and start after October 1 are live during Q4, I just can't find a way to build that into a slicer.

2 REPLIES 2
wacook
Frequent Visitor

@Anonymous Thanks for this, but how would I get it to filter my exhibits and not just a count of ID's as shown above?

Anonymous
Not applicable

Hi @wacook ,

 

I think there should be a [Expire Date] column and a [Start Date] column in your table. Here I suggest you to create an unrelated date table to build the slicer.

Calendar = ADDCOLUMNS( CALENDARAUTO(),"Year",YEAR([Date]),"Qtr",QUARTER([Date]),"Month",MONTH([Date]))

My Sample is as below.

RicoZhou_0-1665046123968.png

Measure:

Current Quarter = 
CALCULATE (
    COUNT ( 'Table'[ID] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Start Date] <= MAX ( 'Calendar'[Date] )
            && 'Table'[Expire Date] > MAX ( 'Calendar'[Date] )
    )
)
Previous Quarter = 
CALCULATE (
    COUNT ( 'Table'[ID] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Start Date] <= EOMONTH ( MAX ( 'Calendar'[Date] ), -12 )
            && 'Table'[Expire Date] > EOMONTH ( MAX ( 'Calendar'[Date] ), -12 )
    )
)

Result is as below.

RicoZhou_1-1665046226170.png

 

Best Regards,
Rico Zhou

 

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

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 Fabric 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