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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Jaesonkim
Frequent Visitor

Counter in between two dates && delivery older than 5 years

Hello, i want to have your best solution again for the dax calculation 

i have 2 simple table as date lookup and contract table.
if i make filter with the date lookup and i choose certain year month, i want to show the contract number, which are in the between the two dates (Contract start ~ Expired date) and product delivery older than 5 years.

Jaesonkim_1-1682408552701.png

https://drive.google.com/file/d/1OGfUmZppS1cLcrbJOJ4M3eOXX9hiT3Tf/view?usp=share_link

 

1 REPLY 1
tamerj1
Super User
Super User

Hi @Jaesonkim 
Please refer to attached sample file with the proposed solution

3.png

FilterMeasure = 
COUNTROWS ( 
    FILTER ( 
        'Table',
        DATEDIFF ( 'Table'[Product delivery], TODAY ( ), YEAR ) >= 5
            && 'Table'[Contract start] <= MAX ( 'Lookup Date'[Date] )
            && 'Table'[Expired date] >= MIN ( 'Lookup Date'[Date] )
    )
)

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.