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

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

Reply
Anonymous
Not applicable

Need to calculate occurrence of an object between two dates from an excel

Hello Guys,

 

I want to calculate the count of Ip address repeated between the createion date and  90 days ago this creation date 
plz help me how to calculate 

Ip                   Creation Date   creation date 90 days ago

10.10.122.10    1/1/2021         3/10/2020

12.12.199.10     4/1/2021        6/10/2021
10.10.122.10    1/1/2021          3/10/2021
13.12.12.10      1/1/2021          3/10/2020

 

result should be 
count
1
1
2
1

Thanks

Pra137

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous 

Try this code to create a calculated column.

Count =
CALCULATE (
    COUNTROWS ( 'Sample' ),
    FILTER (
        'Sample',
        AND (
            'Sample'[Ip] = EARLIER ( 'Sample'[Ip] ),
            'Sample'[creation date 90 days ago]
                <= EARLIER ( 'Sample'[creation date 90 days ago] )
        )
    )
)

Result is as below.

1.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.

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@Anonymous , a new column

 


New colume =
var _dt1 = [Creation Date] - 90
var _dt2 = [Creation Date] + 90
return
countx(filter(Table, [Creation Date] >=_dt1 && [Creation Date] <=_dt2), [ip])

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
Anonymous
Not applicable

It show me the total count of Ip address in column like 1999 for all rows i want to see 1,2,3 count of ip

Anonymous
Not applicable

Hi @Anonymous 

Try this code to create a calculated column.

Count =
CALCULATE (
    COUNTROWS ( 'Sample' ),
    FILTER (
        'Sample',
        AND (
            'Sample'[Ip] = EARLIER ( 'Sample'[Ip] ),
            'Sample'[creation date 90 days ago]
                <= EARLIER ( 'Sample'[creation date 90 days ago] )
        )
    )
)

Result is as below.

1.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 Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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.