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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
JeffreeN
New Member

DAX to create new column with if/or statement

I am new to Power BI, and not yet across DAX.

I have 7 existing columns with yes / no data:    "as"    "ts"    "hns"   "mhs"    "ws"     "cs"    "rtc"

I need a new column to effect of: if "as" or "ts" or "hns" or "mhs" or "ws" r=or "cs" or "rtc" = yes, return yes, otherwise return no 

2 REPLIES 2
ThxAlot
Super User
Super User

It's way more concise and robust to use PQ to achieve this result

 

= Table.AddColumn(Source, "Chk", each if List.Contains(Record.ToList(_), "Yes", Comparer.OrdinalIgnoreCase) then "Yes" else "No")

 

ThxAlot_0-1689590386627.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



rubayatyasmin
Super User
Super User

Hi, @JeffreeN 

 

see if this DAX works. 

 

New Column =
IF(
OR('Table'[as] = "Yes", 'Table'[ts] = "Yes", 'Table'[hns] = "Yes", 'Table'[mhs] = "Yes", 'Table'[ws] = "Yes", 'Table'[cs] = "Yes", 'Table'[rtc] = "Yes"),
"Yes",
"No"
)

 

it will return yes if any of the column value is yes. other wise it will return no. 

If my assistance helped you in any way, hit 👍

 

rubayatyasmin_0-1689517080227.png


Did I answer your question? Mark my post as a solution!super-user-logo

Proud to be a Super User!


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.