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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
KellyLen
Helper III
Helper III

Filtering rows with multiple conditions

Hello,

 

I have a problem with filtering certain rows. 

I would like to filter out from all of my data rows, which firstly in column "Category" are "Candies" and column "Accounts" are anything else but "123" and "345". So I would like to exclude from my data all the other Candies accounts beside "123" and 345". This Candies filtering is important as I have like hundred other category as well. 

 

Best regards,

Kelly  

9 REPLIES 9
Ashish_Mathur
Super User
Super User

Hi,

 

Have you tried applying these conditions in the Query Editor?  If yes, then what problem do you face?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi! 

 

Yes, I tried to filter it in query editor, but then it filtered all the "Candies" out and did not left any candies to the data. And advcanced filtering does not allow me to create a condition "anything else but "123""? 

Hi,

 

Share some data to work with and also show your expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I created an example to excel:

image.png

And result should be like this:

image.png

All the other candies with accounts, which are not 123 and 345, are gone. 

 

Does this help? 

Hi,

 

Why are 879 and 478 appearing there?  I just do not understand your filtering conditions.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Hi,

 

It is hard to make an example table to you, I cannot present the real data. But these are just for example that you could understand that I have not got only candies with accounts, but other things as pies with the same accounts as well. So actually I need that all the other data would remain the same and Candies would appear only with accounts 123 and 345. Does it make more sense? 🙂 

Is there anyone, who could help? 

Hi @KellyLen,

 

In the power query add this column to your data:

 

if [Category] <> "Candies" 

  then "keep" 

else 
        if  ([Category] = "Candies" and [Accounts] = 123 ) 
        or  ([Category] = "Candies" and [Accounts] = 658 )   
       then "keep" 
else ""

 

Then just do a filter on keep and delete the column you just created:

 

TTT.png

 

Regards,

MFelix


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Super! It worked, if I added "" to the accounts as well. 🙂 

 

Thank you very much! 

 

Best regards,

Kelly 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.