Forum Discussion

tangutoori's avatar
tangutoori
Icon for Helper III rankHelper III
2 years ago

Filter the repeated ID which match both columns

 Hello,

CURRENT OUTPUT Is a table view,

Var is a measure. 

ID is a column.

If is ID is repeated then compare the Old column New column, if both are matching then hide that record. 

 

CURRENT EXPECTED
IDOldNewvar ID Newvar
APPLE|INDIA|AA15064AA15064AA15064200 APPLE|INDIA|AA15064AA15064AA15065200
APPLE|INDIA|AA15064AA15064AA15065200 APPLE|INDIA|A15066A15066A15066300
APPLE|INDIA|A15066A15066A15066300 APPLE|INDIA|A15067A15067A15067400
APPLE|INDIA|A15067A15067A15067400 APPLE|INDIA|A15068A15068A15068500
APPLE|INDIA|A15068A15068A15068500 APPLE|INDIA|A15069A15069A15069600
APPLE|INDIA|A15069A15069A15069600 APPLE|INDIA|A1510A1510A1510300
APPLE|INDIA|A1510A1510A1510300     

 

please do needful.

 

Regards,

Reddy.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi  tangutoori 

     

    You can create a measure as follows.

     

    HideRows =
    VAR _countID =
        CALCULATE ( COUNT ( 'Table'[ID] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
    RETURN
        IF (
            _countID > 1
                && SELECTEDVALUE ( 'Table'[Old] ) = SELECTEDVALUE ( 'Table'[New] ),
            0,
            1
        )

     

     

    Then put the measure into the filter so that the visual only shows data where the measure is equal to 1.

     

    Is this the result you expect?

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