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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Heleo
Frequent Visitor

Rows exclusion based on 2 columns

Hi,

 

I'm currently trying to filter a table to exclude rows based on the value of one column, but I also want that if one value of another column was associated with it then exclude it completely as well. 

 

Example of what I have:

Company NameOption
ELEBank
ELEComputer
STETV
STEComputer
JAQBank
THOTV

 

Now, I want to remove all the companies that have the Option "Bank". But, if I just simply filter my table to exclude the Option value "Bank", it removes just the rows with this value, like this:

Company NameOption
ELEComputer
STETV
STEComputer
THOTV

 

However, my company name "ELE" which has 2 options "Bank" and "Computer" still appears with the row "Computer", and I don't want it. Since it had the value "Bank" associated, I want all the rows with this company name to be excluded.

This is the result I'd like with my filter:

Company NameOption
STETV
STEComputer
THOTV

 

How could I manage to achieve this? 

I thought of filtering first on the companies that had the value "Bank" to retrieve these values, then excluding the rows that had these company names. But I don't really know how to start. 

 

Thank you for your help!

3 REPLIES 3
mahenkj2
Solution Sage
Solution Sage

Hi @Heleo 

Same way you explained, you need to filter two times. You can try in power query:

 

mahenkj2_0-1686147220237.png

 

mahenkj2_1-1686147264091.png

 

Hope it helps.

Thank you for your answer, the thing is that I don't want to have to write all the company names myself to exclude them. I would like them to be retrieved and excluded automatically. In my example, I only have one value but in real life, I have thousands. 🙂 

Hi @Heleo ,

 

To work efficiently in power bi or any such reporting tool, I would recommend using best practices. One of the key thing related to your application is, using star schema or dimension and fact tables. The attributes shown in the sample data you showed is kind of dimensions and should be used as a slicer or filter. I am sure in your real data, you would have several other columns, which will carry mostly numeric values or some other attributes. That should work as fact tables and then you create relationships between dimension and fact tables.

 

If you are a new user, it might be difficult for you to quickly grasp what I said above and my expalnation not might be so succint, but it should give you a direction to start with.

 

Just look at some snapshots I wish you could check:

mahenkj2_0-1686149324393.png

 

Then your report might be like this:

mahenkj2_1-1686149368527.png

 

There are further to this to learn about design considerations for star schema and I dont want to overwhelm for this question.

 

Hope it helps.

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.