Forum Discussion

Syndicate_Admin's avatar
Syndicate_Admin
Administrator
2 years ago
Solved

Remove duplicates in a numeric column

I have a problem when creating a table in Power BI where showing the ID of a client/user duplicates the rows and I need to show the "last row", the problem is that being a numeric column that option is not there.

I attach here how the repeat customer number looks.

And when you right-click to show the last row, you don't see that option:

Do you have any idea how to display the last or first row of a found value?

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Syndicate_Admin 

     

    lbendlin Thank you very much for your prompt reply.

     

    For your question, here is the method I provided:

     

    I noticed that the teamleader column and the reta_de_ventas column are changed in your data.

     

    Therefore, I would suggest you to group the teamleader column according to it and sort the reta_de_ventas column to achieve displaying the last row of data.

     

    Here's some dummy data

     

    “Table”

     

    Create measures.

     

    Rank = 
    VAR _RANK = 
        RANKX(
            FILTER(
                ALL('Table'), 
                'Table'[teamleader] = MAX('Table'[teamleader])
            ), 
            CALCULATE(SELECTEDVALUE('Table'[reta_de_ventas])),,ASC,Dense
        )
    RETURN _RANK

     

    Mark = 
    var _maxRank = 
        MAXX(
            FILTER(
                ALL('Table'), 
                'Table'[teamleader] = MAX('Table'[teamleader])
            ), 
            [Rank]
        )
    RETURN
    IF(
        [Rank] = _maxRank, 
        1, 
        0
    )

     

    Filter values with a "Mark" of 1.

     

     

    Here is the result.

    Regards,

    Nono Chen

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

     

4 Replies