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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Creating a custom column with multiple TRUE responses

Beginner user to powerbi/power query....I am trying to create a custom column which returns true or false when two separate columns both equal "true". 

e.g. "if [column1] OR [column2] = "true" then "true" else "false", but it returns a 'token 'then' expected error. What's the best way to create columns based on multiple true values?

2 ACCEPTED SOLUTIONS
Fowmy
Super User
Super User

@Anonymous 

If you can use the following method as well in a new custom column, it evaluates to True when both the columns are true:

[Column1] and [Column2]

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

Hi @Anonymous ,

 

I think this is probably due to your column formats. I've assumed they are text format as your example stated "true" as the condition.

If the columns to be evaluated are actually boolean data type, then you can use the shortcut that @Fowmy has suggested, something like this:

if [Column1] or [Column2] then "true"
else "false"

 

The above will output text values. If you want to output actual boolean type, then just remove the quote marks from the output values:

if [Column1] or [Column2] then true
else false

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Thank @BA_Pete - the syntax works, but all results appear false when I'm expecting most to be true. I've been mindful of case sensitivity and checked both ways but the same problem persists.

Hi @Anonymous ,

 

I think this is probably due to your column formats. I've assumed they are text format as your example stated "true" as the condition.

If the columns to be evaluated are actually boolean data type, then you can use the shortcut that @Fowmy has suggested, something like this:

if [Column1] or [Column2] then "true"
else "false"

 

The above will output text values. If you want to output actual boolean type, then just remove the quote marks from the output values:

if [Column1] or [Column2] then true
else false

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Fowmy
Super User
Super User

@Anonymous 

If you can use the following method as well in a new custom column, it evaluates to True when both the columns are true:

[Column1] and [Column2]

 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

BA_Pete
Super User
Super User

Hi @Anonymous ,

 

The correct syntax to use in Power Query would be this:

if [Column1] = "true" or [Column2] = "true" then "true"
else "false"

 

Pay close attention to the capitalisation as well - Power Query is entirely case-sensitive.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

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.