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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now

Reply
Anonymous
Not applicable

add conditional column

How to add 'and' under 'add conditional column'? 

 

if 'target' is great than 2 and *****, then ***

CRM.PNG

1 ACCEPTED SOLUTION
GilbertQ
Super User
Super User

Hi @Anonymous

 

In order to do that you will need to add a Custom Column


The syntax is the following below and NOTE that it is case sensitive

 

if [Target] > 2 and [Other column] = "Closed" then "My Output Closed"
else if [Target] > 1 and [Other column] = "Open" then "My Output Open"
 else "Other Output"

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

5 REPLIES 5
GilbertQ
Super User
Super User

Hi @Anonymous

 

In order to do that you will need to add a Custom Column


The syntax is the following below and NOTE that it is case sensitive

 

if [Target] > 2 and [Other column] = "Closed" then "My Output Closed"
else if [Target] > 1 and [Other column] = "Open" then "My Output Open"
 else "Other Output"

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

@GilbertQ thanks, but i don't really get it.  how do i add 'and' in the picture i attached?  see above. 

Hi there you would add this as a Custom Column in the Edit Queries in Power BI Query Editor




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Anonymous
Not applicable

@GilbertQ yes, i'm in edit queries/add column/conditional column.  but where to add 'and'

 

for example below, how should i say

if actualstart = 11/07/2017 and (or) ****, then output = 13/07/2017. 

 

 

CRM.PNG

Hi there, instead of using the Conditional Column use the Custom Column and then paste the code in there.

Currently with the Conditional Column it does not allow you to put in the "and"




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

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.

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.