Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
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?
Solved! Go to Solution.
@nok see attached pbix file, tweak the solution as you see fit. Here is the output.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@nok before the last step (removal of all column), click expand arrow on the all column, it will list all the columns, just select the columns you need and then remove the all column.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@nok there is another function in PQ which you need to copy in your pbix file.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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"?
@nok see attached pbix file, tweak the solution as you see fit. Here is the output.
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
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 got it, ID 2 has only one record. Hang tight for the solution
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
@nok why for ID 2, both the rows are not deleted becuase both contains "Reversed_Image"
Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!
Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo
If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤
Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.