Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
4 years ago
Solved

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 ID Date of call ...
  • tamerj1's avatar
    tamerj1
    4 years ago

    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" 
        )
    )