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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
avitalo1
Frequent Visitor

filtering based on custom column

Hello,

I am relatively new to M and am trying to create steps I can apply to various files. I was able to split the columns I needed to split and create parameters. However when I try to filter the relevent information I hav run into problems.

 

I have written the following M code:

Table.AddColumn(#"Replaced Value", "hu and other", each (Table.Contains([Affiliations authors 1] or [Affiliations author last], "Hebrew Univ" or #"other institution") and Table.Contains ([Affiliations authors 2] or [Affiliations authors 3] or [Affiliations authors 4] or [Affiliations authors 5], "Hebrew Univ" or #"other institution")))

 

all of the columns are type text.
I'm getting an error:

Expression.Error: We cannot convert the value " Inst Canc Res, Onco..." to type Logical.
Details:
Value= Inst Canc Res, Oncogenet Team, London, England
Type=[Type]

 

abviously I'm missing something and any help would be much appreciated

 

Thanks

Avital

1 ACCEPTED SOLUTION

That makes sense, thanks. I will rethink my approach and see if I can get the results I need.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi,

 

I think it's because the column values [Affiliations authors 1], [Affiliations author last], ..., [Affiliations authors 5] aren't boolean (this means: true/ false). Since they aren't boolean, you can not connect them with an "or" keyword.

That makes sense, thanks. I will rethink my approach and see if I can get the results I need.

Helpful resources

Announcements
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Top Kudoed Authors