Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Find previous record - Help

Hello, I used this WONDERFUL youtube video to find duplicate/repeat records in my data.    https://www.youtube.com/watch?v=xN2IRXQ2CvI   High level it Looks up rows with the same value and tells m...
  • v-juanli-msft's avatar
    6 years ago

    Hi Anonymous 

    If my previous reply helped you, could you kindly accept it as a solution so people may find the solutions quickly?

    If the problem still exists, please check the workarounds below:

    Create calcualated columns below:

    repeated =
    VAR re =
        CALCULATE (
            COUNT ( 'Table 2'[Issue] ),
            FILTER (
                'Table 2',
                DATEDIFF ( 'Table 2'[Date], EARLIER ( 'Table 2'[Date] ), DAY ) <= 5
                    && 'Table 2'[Date] <= EARLIER ( 'Table 2'[Date] )
            )
        )
    RETURN
        IF ( re > 1, "Yes", "No" )
    
    previous record = CALCULATE(MAX('Table 2'[Issue]),FILTER('Table 2','Table 2'[Date]<EARLIER('Table 2'[Date])))
    
    cause a repeat =
    VAR c =
        CALCULATE (
            MAX ( 'Table 2'[previous record] ),
            FILTER ( 'Table 2', 'Table 2'[repeated] = "Yes" )
        )
    RETURN
        IF ( [Issue] = c, c, "No" )
    
    

     

    Best Regards
    Maggie
    Community Support Team _ Maggie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.