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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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