Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Syndicate_Admin
Administrator
Administrator

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.

lautarotita_0-1713297880787.png

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

lautarotita_1-1713297930769.png

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

1 ACCEPTED SOLUTION
v-nuoc-msft
Community Support
Community Support

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”

vnuocmsft_1-1714549355217.png

 

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.

 

vnuocmsft_2-1714549563950.png

 

Here is the result.

vnuocmsft_3-1714549697977.png

Regards,

Nono Chen

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

 

View solution in original post

4 REPLIES 4
v-nuoc-msft
Community Support
Community Support

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”

vnuocmsft_1-1714549355217.png

 

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.

 

vnuocmsft_2-1714549563950.png

 

Here is the result.

vnuocmsft_3-1714549697977.png

Regards,

Nono Chen

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

 

lbendlin
Super User
Super User

Sort in the way you need it sorted and then do a DISTINCT on that column.

 

 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

He won't let me make a DISTINCT in the column because he says he expected a column and I gave him several.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
Fabcon_Europe_Social_Bogo

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors