cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
KellyLen Regular Visitor
Regular Visitor

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
Super User
Super User

Re: Filtering rows with multiple conditions

Hi,

 

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

Highlighted
KellyLen Regular Visitor
Regular Visitor

Re: Filtering rows with multiple conditions

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""? 

Super User
Super User

Re: Filtering rows with multiple conditions

Hi,

 

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

KellyLen Regular Visitor
Regular Visitor

Re: Filtering rows with multiple conditions

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? 

Super User
Super User

Re: Filtering rows with multiple conditions

Hi,

 

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

KellyLen Regular Visitor
Regular Visitor

Re: Filtering rows with multiple conditions

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? Smiley Happy 

KellyLen Regular Visitor
Regular Visitor

Re: Filtering rows with multiple conditions

Is there anyone, who could help? 

Super User
Super User

Re: Filtering rows with multiple conditions

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



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

Proud to be a Datanaut!




KellyLen Regular Visitor
Regular Visitor

Re: Filtering rows with multiple conditions

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

 

Thank you very much! 

 

Best regards,

Kelly 

Helpful resources

Announcements
Can You Solve These Challenge

Challenge: Can You Solve These?

Find out how to participate in the first Power BI 'Can You Solve These?' challenge.

Community News & Announcements

Community News & Announcements

Get your latest community news and announcements.

Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Users Online
Currently online: 366 members 3,381 guests
Please welcome our newest community members: