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
Anonymous
Not applicable

How to compare text across multiple columns

Hi,

 

How do i compare text across multiple columns ignoring any blanks and ignoring case.

e.g.

 

Column1Column2Column3Column4Column5Expected Result
catcatcatcatcatTRUE
catCatCATcatcatTRUE
 catcat  TRUE
catcatcatercatcatFALSE

 

In Excel, i used the following formula and it worked fine:

 

=SUMPRODUCT((A2:E2<>"")/COUNTIF(A2:E2,A2:E2&""))=1

 

Thanks for any help.

1 ACCEPTED SOLUTION
lbendlin
Super User
Super User

Result =
var a= {[Column1],[Column2],[Column3],[Column4],[Column5]}
var b=FILTER(a,[Value]<>"")
return COUNTROWS(DISTINCT(b))=1
 
or more brutish:
Result = COUNTROWS(FILTER(DISTINCT({[Column1],[Column2],[Column3],[Column4],[Column5]}),[Value]<>""))=1

View solution in original post

4 REPLIES 4
lbendlin
Super User
Super User

Result =
var a= {[Column1],[Column2],[Column3],[Column4],[Column5]}
var b=FILTER(a,[Value]<>"")
return COUNTROWS(DISTINCT(b))=1
 
or more brutish:
Result = COUNTROWS(FILTER(DISTINCT({[Column1],[Column2],[Column3],[Column4],[Column5]}),[Value]<>""))=1
Anonymous
Not applicable

Both Solutions work.  Thank You so much.

lbendlin
Super User
Super User

here's a fun way:

 

= SWITCH(TRUE(),[Column1]<>[Column2],FALSE(),[Column1]<>[Column3],FALSE(),[Column1]<>[Column4],FALSE(),[Column1]<>[Column5],FALSE(),TRUE())

Anonymous
Not applicable

Doesn't seem to work if there are any blank columns.

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.