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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Removing Specific Rows from the Dataset

Hello, 

 

I need to remove specific, nonconsecutive rows within my dataset in Power BI. For example, I have 5 different locations (1-5) and 5 different products (A-E). I need to filter out Location 1, Product B, and Location 3, Product D. When I try to do this in the data query, it seems to remove either all products for location 1 or the specific product for all locations. When I try to use the remove rows feature, it only allows me to remove from the top or bottom, and the rows must be consecutive. I cannot seem to remove very specific rows. Please help! My data is confidential, but below is a sample with the highlighted rows as the rows I need removed from my dataset in Power BI. Thank you!! 

 

mstuve_0-1598543806687.png

 

Marie

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@Anonymous - Create a column that concatenates your two columns. You may have to do a type conversion for your numeric column,

 

Text.From([Location]) & [Product]

 

Then you can remove just the rows you want.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Anonymous , refer

https://www.pbiusergroup.com/communities/community-home/digestviewer/viewthread?MessageKey=a1cfd615-a55f-4ef1-a60e-2b5d8b7c3d88&CommunityKey=b35c8468-2fd8-4e1a-8429-322c39fe7110&tab=digestviewer

https://community.powerbi.com/t5/Desktop/M-Power-Query-Removing-entire-rows-based-on-condition/td-p/367563

https://www.quora.com/In-Power-Query-can-I-remove-rows-based-on-a-particular-value-in-a-column

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here
mahoneypat
Microsoft Employee
Microsoft Employee

Add a custom column like this to get more specific

 

if [Location] = "Location 1" and [Product] = "Product B" then 1 else 0

 

Then you can just filter out the rows with 1 in the new column.

 

If this works for you, please mark it as the solution.  Kudos are appreciated too.  Please let me know if not.

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Greg_Deckler
Super User
Super User

@Anonymous - Create a column that concatenates your two columns. You may have to do a type conversion for your numeric column,

 

Text.From([Location]) & [Product]

 

Then you can remove just the rows you want.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

insert palm to face for not thinking about this. Thank you!!!! 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.