cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Regular Visitor

Remove duplicates based on two columns

Hello,

 

The data from my invoices is collected per invoice line, but i only want to have one line number per invoice. So every invoice number can only have one unique Line number and the rest of the rows can be deleted, if this makes any sense.

 

 

So I want to transform this:

Knipsel.PNG

 

into this:

 

Knipsel.PNG

but ofcourse on a much grander scale.

how can i do this? thanks in advance!

1 ACCEPTED SOLUTION

Accepted Solutions

@Bryan1002 

You can only filter the original table to only show 1 line number, but cannot remove roles.

 

There is a workaround that you can create a new table and use it to do calculations and create visuals.

Table 2 = CALCULATETABLE('Table',FILTER('Table',[Line Number]=MIN('Table'[Line Number])))


Paul Zheng _ Community Support Team
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

3 REPLIES 3
Super User IV
Super User IV

@Bryan1002 , In power query you use remove duplicates.

https://www.youtube.com/watch?v=Hc5bIXkpGVE

 

In dax

Table = distinct(Table)

Table = distinct(All(Table[Invoice Numer], Table[Line inumber Invoice]))

 

Please provide your feedback comments and advice for new videos
Tutorial Series Dax Vs SQL Direct Query PBI Tips
Appreciate your Kudos.



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

@amitchandak  thanks for your reply, but I dont want to remove every duplicate I just want Every invoice number to have one unique Line number. So Invoice number 500012 can only have one unique value but it doesnt matter that this unique value has duplicates. so in the example below the invoice has 3 unique line numbers but I only want 1 of them and the rest can be deleted.

 

so this:

Knipsel.PNG

 

Becomes this:

Knipsel1.PNG

 

Any idea how to achieve this?

@Bryan1002 

You can only filter the original table to only show 1 line number, but cannot remove roles.

 

There is a workaround that you can create a new table and use it to do calculations and create visuals.

Table 2 = CALCULATETABLE('Table',FILTER('Table',[Line Number]=MIN('Table'[Line Number])))


Paul Zheng _ Community Support Team
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

Helpful resources

Announcements
November Update

Check it Out!

Click here to read more about the November 2020 Updates!

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

secondImage

Power Platform October Community Highlights

Check out the top community contributors across all of the communities

secondImage

Create an end-to-end data and analytics solution

Learn how Power BI works with the latest Azure data and analytics innovations at the digital event with Microsoft CEO Satya Nadella.

Top Solution Authors
Top Kudoed Authors