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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
Anonymous
Not applicable

Using two sets of slicers with AND condition

I am beginner. I have started a Power BI project with error codes in Vehicles.


I have imported an Excel sheet with 200.000 rows of various Error Codes for some vehicles, using one Table.

An Error Code is "ECU" and "DTC Code" combined, (example  G3-A1)  
Here is an simplified Example table with 3 columns.

VEHICLE IDECUDTC Code
3G1A1
2G1A1
5G3A1
3G1A2
3G3A2
4G4A2
1G1A2
2G2A2
3G3A1
5G2A2
1G2A3

 

Sometimes I need to search for vehicles ID's with two Error Codes using an AND condition.

Example: Which Vehicle IDs have both Error Codes "G2-A2" AND "G1-A1". 

If I manually look in the table I can see Vehicle ID 2 is the only Vehicle with both Error Codes. 

But see no solution to implement this in my Power BI report with my beginner knowledge.

If the report was working as I want to, the result would look something like this:

VEHICLE IDECU1DTC Code1ECU2DTC2 Code 2
2G1A1G2A2

 

I was thinking maybe need to duplicate the existing table, so that everything is in two separate tables.

ECU1 / DTC Code 1 from the first (orignal Table) and ECU2 / DTC Code 2  from the duplicate table.

I tried this but still had no luck.  Maybe there is better ways. 

Is it possible to set up my Power BI report so I can use multible filtering on same table?

1 ACCEPTED SOLUTION
JoaoMarcelino
Responsive Resident
Responsive Resident

Hi @Anonymous !

From what I can understand, what you need is to merge the table with itself and then expand only the columns you want. After that, you can create a new column that is the concatenation of the 4 columns. In the end, as safety, you should remove the duplicates of the whole table. Lets start? 🙂

1. Open Power Query

JoaoMarcelino_0-1669229284368.png

2. Click on the query you want and choose Merge

JoaoMarcelino_1-1669229343408.png

3. Choose itself and merge it by vehicleid

JoaoMarcelino_2-1669229425461.png

 

4. Click on Expand and choose the columns you want to bring

JoaoMarcelino_3-1669229525251.png

 

5. Add new column and write something like this:
= [ECU]&"-"&[DTC Code]&"&"&[ECU.1]&"-"&[DTC Code.1]
(keep in mind you need to adjust the name of the columns in accordance)

JoaoMarcelino_4-1669229617907.png

6. Remove duplicates on the new column "Both codes" to prevent mistakes and data duplication

 

JoaoMarcelino_5-1669229973789.png

This should do the trick! From now on you can use the new column as filter to your reports and analysis 🙂

Sample file attached if needed

 

Hope I was of assistance!
Cheers
Joao Marcelino

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

 

View solution in original post

1 REPLY 1
JoaoMarcelino
Responsive Resident
Responsive Resident

Hi @Anonymous !

From what I can understand, what you need is to merge the table with itself and then expand only the columns you want. After that, you can create a new column that is the concatenation of the 4 columns. In the end, as safety, you should remove the duplicates of the whole table. Lets start? 🙂

1. Open Power Query

JoaoMarcelino_0-1669229284368.png

2. Click on the query you want and choose Merge

JoaoMarcelino_1-1669229343408.png

3. Choose itself and merge it by vehicleid

JoaoMarcelino_2-1669229425461.png

 

4. Click on Expand and choose the columns you want to bring

JoaoMarcelino_3-1669229525251.png

 

5. Add new column and write something like this:
= [ECU]&"-"&[DTC Code]&"&"&[ECU.1]&"-"&[DTC Code.1]
(keep in mind you need to adjust the name of the columns in accordance)

JoaoMarcelino_4-1669229617907.png

6. Remove duplicates on the new column "Both codes" to prevent mistakes and data duplication

 

JoaoMarcelino_5-1669229973789.png

This should do the trick! From now on you can use the new column as filter to your reports and analysis 🙂

Sample file attached if needed

 

Hope I was of assistance!
Cheers
Joao Marcelino

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Kudoed Authors