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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Calculated column repeated calls

Hi! 

 

I'm looking to make an column in PowerBi which measured if a call is a repeated call or not within 1 month of the last month. 

 

The data looks like this:

 

Customer IDDate of callColumn Needed: Repeated Customer
11-1-2021No
18-1-2021yes
17-2-2021yes
21-1-2021no
23-2-2021no
25-2-2021yes

 

I was thinking about an IF statement but can't really figure out how to do the dates part. 

1 ACCEPTED SOLUTION

Hi @Anonymous 

 

First Date = 
VAR NearestDate =
    MAXX ( 
        FILTER ( 
            'Table', 
            'Table'[Customer ID] = EARLIER ( 'Table'[Customer ID] )
                && 'Table'[Date of call] < EARLIER ( 'Table'[Date of call] )
        ),
        'Table'[Date of call]
    )
VAR Result =
    IF (
        ISBLANK ( NearestDate ),
        'Table'[Date of call],
        NearestDate
    )
RETURN
    Result
Needed: Repeated Customer = 
IF ( 
    'Table'[First Date] = 'Table'[Date of call], 
    "No",
    IF ( 
        DATEDIFF ( 'Table'[First Date], 'Table'[Date of call], DAY ) >= 31, 
        "No", 
        "Yes" 
    )
)

 

View solution in original post

7 REPLIES 7
tamerj1
Super User
Super User

Hi @Anonymous 
You are right. It is a two step procedure:
1. Retreieve the first date in a new calculated column 

First Date =
MINX (
    FILTER ( 'Table', 'Table'[Customer ID] = EARLIER ( 'Table'[Customer ID] ) ),
    'Table'[Date of call]
)

2. Use the IF in another new calculated column:

Needed: Repeated Customer =
IF ( 'Table'[First Date] = 'Table'[Date of call], "No", "Yes" )
Anonymous
Not applicable

Almost there! I need one more step. It is possible that there is more than 2 calls per call id. In this case i don't want to take the min date but the closest min date.

 

So for example:

Customer IDDate of callRepeated customer:Min date:
11-1-2021No1-1-2021
18-1-2021yes1-1-2021
17-2-2021yes8-1-2021

 

You know how to do this?

 

Thanks in advance! 

Anonymous
Not applicable

As showed in the example. I need to calculate if an call is within the delta of 31 days (one month) because if its greater than 31 days it is not measured as an repeated call. This is not possible when the min date is always the earliest date this is not possible with customers who called more than 2 times. 

Hi @Anonymous 

 

First Date = 
VAR NearestDate =
    MAXX ( 
        FILTER ( 
            'Table', 
            'Table'[Customer ID] = EARLIER ( 'Table'[Customer ID] )
                && 'Table'[Date of call] < EARLIER ( 'Table'[Date of call] )
        ),
        'Table'[Date of call]
    )
VAR Result =
    IF (
        ISBLANK ( NearestDate ),
        'Table'[Date of call],
        NearestDate
    )
RETURN
    Result
Needed: Repeated Customer = 
IF ( 
    'Table'[First Date] = 'Table'[Date of call], 
    "No",
    IF ( 
        DATEDIFF ( 'Table'[First Date], 'Table'[Date of call], DAY ) >= 31, 
        "No", 
        "Yes" 
    )
)

 

Anonymous
Not applicable

This is it! Thank you very much!

Anonymous
Not applicable

The expected result is an calculation based on the first two columns as seen in column C. So if their is an call from the same ID within one month before than YES else NO. 

Tanushree_Kapse
Impactful Individual
Impactful Individual

Hi @Anonymous ,

Not very clear with your question.

Can you please provide the sample result or the expected result here.

 

Thanks

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.