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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
Breen
Frequent Visitor

How to make a DAX "flag" column that holds 'Yes' when other columns hold 'Yes'

I am trying to replicate the below Tableau column in PowerBI DAX: 

Breen_0-1726042636988.png

That column will equal 'Yes' if any of the designated columns hold 'Yes' for each applicant.

 

I'm struggling to replicate this in PBI. My current code is not returned the expected results: 

Breen_1-1726042829683.png

 

Can anyone help?

1 ACCEPTED SOLUTION
Tsrivastava
Frequent Visitor

You can use 

Grade Discount =

var ConditionCount = IF(SELECTEDVALUE('Table'[Attainment Offer?])="Yes",1)+IF(SELECTEDVALUE('Table'[Sports Scholar?])="Yes",1)+IF(SELECTEDVALUE('Table'[A2B])="Yes",1,0)
return IF(ConditionCount>=1,1,0)

View solution in original post

5 REPLIES 5
Anonymous
Not applicable

Hi @Breen,

It's been a while since I've heard back from you and I wanted to follow up. Have you had a chance to try the solution that has been offered? If the issue has been resolved, could you mark the post as resolved? If you're still experiencing challenges, please feel free to let us know and we'll be happy to continue to help!
Looking forward to your reply!

Tsrivastava
Frequent Visitor

You can use 

Grade Discount =

var ConditionCount = IF(SELECTEDVALUE('Table'[Attainment Offer?])="Yes",1)+IF(SELECTEDVALUE('Table'[Sports Scholar?])="Yes",1)+IF(SELECTEDVALUE('Table'[A2B])="Yes",1,0)
return IF(ConditionCount>=1,1,0)
Breen
Frequent Visitor

Thanks for your reply. Unfortunately this has increased the difference between the PBI and Tableau. See below: 

Breen_1-1726045043151.png

 

 

@Breen ,

The logic in Tableau is that if exactly one of the conditions is "YES", then the final result is also "YES". Otherwise it should be "NO".

Your code above does exactly the same, so the result should be correct without adding any changes.

Do you still see differences between Tableau and PBI? If you can create a sample dataset, it will be easier to verify.

 

PBI_SuperUser_Rank@1x.pngMemorable Member | Former Super User
If I helped, please accept the solution and give kudos! 
Linkedin

 

lkalawski
Super User
Super User

Hi @Breen ,

 

The Tableu code returns is if ONLY ONE of the conditions is YES. If it turns out that there are more YES, the code returns "No".

 

To make your code check if any factor is equal to "YES", please change the condition to:

RETURN
IF (ConditionCount >= 1, "YES", "NO")

 

PBI_SuperUser_Rank@1x.pngMemorable Member | Former Super User
If I helped, please accept the solution and give kudos! 
Linkedin

 

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.