Forum Discussion
Detecting duplicates by validating two column
Hello :)
Im new at power bi, so im sorry for the noob question :P
So i have a table more or less like this
| Company | Stage |
| microsoft | MAL |
| asus | MQL |
| toshiba | SAL |
| lg | MAL |
| asus | MQL |
| nokia | MAL |
As you can see i have the company "asus" its duplicated, but i just want to count it once.
So i need to create a new column that verifies if the company its duplicated and if it haves the same stage and give me a result like this:
| Company | Stage | Stage verified |
| microsoft | MAL | MAL |
| asus | MQL | MQL |
| toshiba | SAL | SAL |
| lg | MAL | MAL |
| asus | MQL | |
| nokia | MAL | MAL |
Thanks :)
Please refer to the steps below to achieve your requirement.
- Add a index column.(Edit Query)
- Create a column to combine company and stage column.
CompanyStage = Table1[Comapny]&Table1[Stage] - Create your expected column.
outputcolumn = IF(RANKX(FILTER(Table1,Table1[CompanyStage]=EARLIER(Table1[CompanyStage])),Table1[Index],,ASC)>1,BLANK(),Table1[Stage])
Regards,
Charlie Liao
- Add a index column.(Edit Query)
3 Replies
- v-caliao-msftMicrosoft Employee
Please refer to the steps below to achieve your requirement.
- Add a index column.(Edit Query)
- Create a column to combine company and stage column.
CompanyStage = Table1[Comapny]&Table1[Stage] - Create your expected column.
outputcolumn = IF(RANKX(FILTER(Table1,Table1[CompanyStage]=EARLIER(Table1[CompanyStage])),Table1[Index],,ASC)>1,BLANK(),Table1[Stage])
Regards,
Charlie Liao
- jpcbrRegular Visitor
Thats very well thought!!! Thanks a lot :D
- Add a index column.(Edit Query)
- AnonymousNot applicable
That is going to be challenging as presented, because there is no way to differentiate the two rows of asus,mql.
If you don't need the dupes, I would just remove them (via Edit Queries). If you do... what if you had a column that just counted the # of duplicates? That's easy... :)