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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
JoshuaOlayori
New Member

Conditional Column

I have three columns filled with 'yes/no' responses. I want to create a conditional column based on these three columns such that if there are three 'yes', I'll get an output 'this, this, and that'. Is this possible?

1 ACCEPTED SOLUTION

Hi @JoshuaOlayori 

 

You can add a custom column with below code. You can add multiple "else if ... then ..." in the if condition statement for the other six outcomes.

 

Example:

if condition1 then outcome1 

else if condition2 then outcome2

else if condition3 then outcome3

else if ... then ...

else ...

if {[Streaming TV],[Streaming Movies],[Streaming Music]} = {"No","No","No"} then "no streaming" else if {[Streaming TV],[Streaming Movies],[Streaming Music]} = {"Yes","Yes","Yes"} then "TV, Movies, Music" else ""

vjingzhang_0-1673852288868.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

4 REPLIES 4
wdx223_Daniel
Community Champion
Community Champion

Custom=Table.AddColumn(PreviousStepName,"test",each if {[Column1],[Column2],[Column3]} =List.Repeat({"yes"},3) then "this,this, and that" else null)

Mahesh0016
Super User
Super User

@JoshuaOlayori Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

I want to add a new column called 'streaming'', where if it is no across these 3 columns, output will be 'no streaming'. And if it is yes across the 3, output will be 'TV, Movies, Music'. There are 8 different outcomes: YNY, NYY, ETC.I want to add a new column called 'streaming'', where if it is no across these 3 columns, output will be 'no streaming'. And if it is yes across the 3, output will be 'TV, Movies, Music'. There are 8 different outcomes: YNY, NYY, ETC.

Hi @JoshuaOlayori 

 

You can add a custom column with below code. You can add multiple "else if ... then ..." in the if condition statement for the other six outcomes.

 

Example:

if condition1 then outcome1 

else if condition2 then outcome2

else if condition3 then outcome3

else if ... then ...

else ...

if {[Streaming TV],[Streaming Movies],[Streaming Music]} = {"No","No","No"} then "no streaming" else if {[Streaming TV],[Streaming Movies],[Streaming Music]} = {"Yes","Yes","Yes"} then "TV, Movies, Music" else ""

vjingzhang_0-1673852288868.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
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.

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.