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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
setis
Post Partisan
Post Partisan

Multiple column filtering

Dear experts, 

 

I'm trying to create a measure that filter 2 columns of the same table using the "SEARCH"

 

Measure 12 = 
CALCULATE(CALCULATE(DISTINCTCOUNT(Cases[CaseID]);
FILTER( ALL(Cases);
(SEARCH("Accident"; Cases[Event];;BLANK())) ||
(SEARCH("Extraordinary"; Cases[Cover];;BLANK())) ||
(SEARCH("Information"; Cases[Cover];;BLANK()))))

 

As you can see, I'm trying to get the cases where the column Event containts "Accident" or the column Cover contains "Extraordinary" or "Information". 

 

Is it possible to do this in a measure?

1 ACCEPTED SOLUTION
az38
Community Champion
Community Champion

@setis 

try to take all Cases into ordinary quota:

Column = 
IF(
(SEARCH("Accident"; 'Cases'[Event];;0) + SEARCH("Extraordinary"; 'Cases'[Cover];;0) +
SEARCH("Information"; 'Cases'[Cover];;0) > 0;
1;
BLANK()
)

or remove Cases at all

Column = 
IF(
(SEARCH("Accident"; [Event];;0) + SEARCH("Extraordinary"; [Cover];;0) + SEARCH("Information"; [Cover];;0) > 0;
1;
BLANK()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

View solution in original post

11 REPLIES 11
amitchandak
Super User
Super User

Try like


Measure 12 =
CALCULATE(CALCULATE(DISTINCTCOUNT(Cases[CaseID]);
FILTER( ALL(Cases);
(SEARCH("Accident"; Cases[Event];1;0)>0) ||
(SEARCH("Extraordinary"; Cases[Cover];1;0)>0) ||
(SEARCH("Information"; Cases[Cover];1;0)>0))))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
az38
Community Champion
Community Champion

Hi @setis 

try more simple

Measure 12 = 
CALCULATE(CALCULATE(DISTINCTCOUNT(Cases[CaseID]);
FILTER( ALL(Cases);
SEARCH("Accident"; Cases[Event]) > 0 ||
SEARCH("Extraordinary"; Cases[Cover]) > 0 ||
SEARCH("Information"; Cases[Cover]) > 0 
))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thanks @az38 

 

I'm getting this error

 

Capture.PNG

az38
Community Champion
Community Champion

Ok

@setis 

try

Measure 12 = 
CALCULATE(CALCULATE(DISTINCTCOUNT(Cases[CaseID]);
FILTER( ALL(Cases);
SEARCH("Accident"; Cases[Event];;0) > 0 ||
SEARCH("Extraordinary"; Cases[Cover];;0) > 0 ||
SEARCH("Information"; Cases[Cover];;0) > 0 
))

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 @amitchandak 

 

Thanks for your help. It's not working for me. 

 

I'm getting an unrealistic number and when a place the measure on a table with the CaseID, I'm getting the same number in all rows. 

az38
Community Champion
Community Champion

@setis 

show, please, data example, relationships and expected result


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

@az38 

 

Please find a dummy file here https://drive.google.com/file/d/1-e0pVtF0N5uJ2zOO4_cfYcAM-ctFQsNe/view?usp=sharing 

The expected result is this:

Capture.PNG

 

Thanks in advance

az38
Community Champion
Community Champion

@setis 

wow. it look a little bit other task

you need this trigger row-by-row?

maybe you need a simple column ?

Column = 
IF(
(SEARCH("Accident"; Cases[Event];;0) + SEARCH("Extraordinary"; Cases[Cover];;0) +
SEARCH("Information"; Cases[Cover];;0) > 0;
1;
BLANK()
)

 


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thanks @az38 ,

 

Yes, I need it on a row by row.

 

I'm getting a syntax error with the column you sent. Can you see what's wrong?

 

Capture.PNG

az38
Community Champion
Community Champion

@setis 

try to take all Cases into ordinary quota:

Column = 
IF(
(SEARCH("Accident"; 'Cases'[Event];;0) + SEARCH("Extraordinary"; 'Cases'[Cover];;0) +
SEARCH("Information"; 'Cases'[Cover];;0) > 0;
1;
BLANK()
)

or remove Cases at all

Column = 
IF(
(SEARCH("Accident"; [Event];;0) + SEARCH("Extraordinary"; [Cover];;0) + SEARCH("Information"; [Cover];;0) > 0;
1;
BLANK()
)

do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

Thank you! It works now. 

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.