Forum Discussion

Muki's avatar
Muki
Helper I
8 years ago
Solved

filter table based on duplicate values in selected columns

Hi

 

I'm trying to find a solution for below situation.

 

Add a column with amount of duplicate values based upon selected columns ( version, coverage )

For these duplicate records, only keep the records with latest 'starte date' and status 'ok'.

 

 

 

Would really appreciate if you could help me out!

 

Regards

Muki

 

 

 

 

  • Hi Muki

     

    Try this calculated table

     

    Go to Modelling Tab>>>NEW TABLE

     

    Table =
    ADDCOLUMNS (
        SUMMARIZE (
            TableName,
            TableName[version],
            TableName[coverage],
            "Start_Date", CALCULATE ( MAX ( TableName[start date] ), TableName[status] = "ok" )
        ),
        "ID", CALCULATE (
            SELECTEDVALUE ( TableName[id] ),
            TableName[start date] = EARLIER ( [Start_Date] )
        ),
        "Status", "Ok",
        "Count", CALCULATE ( COUNT ( TableName[coverage] ) )
    )

4 Replies

  • Zubair_Muhammad's avatar
    Zubair_Muhammad
    Community Champion

    Hi Muki

     

    Try this calculated table

     

    Go to Modelling Tab>>>NEW TABLE

     

    Table =
    ADDCOLUMNS (
        SUMMARIZE (
            TableName,
            TableName[version],
            TableName[coverage],
            "Start_Date", CALCULATE ( MAX ( TableName[start date] ), TableName[status] = "ok" )
        ),
        "ID", CALCULATE (
            SELECTEDVALUE ( TableName[id] ),
            TableName[start date] = EARLIER ( [Start_Date] )
        ),
        "Status", "Ok",
        "Count", CALCULATE ( COUNT ( TableName[coverage] ) )
    )