Forum Discussion
Remove duplicate rows based on occurrence of a specific string in Power Query
I have a table that follows this structure:
| ID | ImageText |
| 1 | NameFarm.pdf |
| 1 | Reversed_Image_[1].pdf |
| 2 | Reversed_Image_[9].jpg |
| 3 | Reversed_Image_[3].jpg |
| 3 | vintage_paint.jpg |
| 4 | noble.pdf |
I want to create a function, in Power Query, that checks if an ID appears more than once. If so, the BI should delete the row where the "ImageText" column contains the string "Reversed_Image".
If the ID does not repeat, the BI should not delete anything. This function should be executed only when a certain ID repeats.
The final result would be something like this:
| ID | ImageText |
| 1 | NameFarm.pdf |
| 2 | Reversed_Image_[9].jpg |
| 3 | vintage_paint.jpg |
| 4 | noble.pdf |
How can I do this?
7 Replies
- parry2k
Super User
- nok
Advocate II
Hello, parry2k . Thanks for the quick response!
I downloaded your file and tried to use it in my code, but I'm getting an error in the #"Get ImageText" step, saying that the name 'fnGetImageText' was not recognized.
Do I need to change something in this part of 'fnGetImageText' for it to work on my dashboard?
- nok
Advocate II
Thanks for the response, I had managed to find it here 🙂
Just one last question... in my original table, I have more columns than "ID" and "ImageText". How do I make the last step bring all the other columns as well, and not just "ID" and "ImageText"?