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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
jos818
Helper I
Helper I

Create a column to easily use as a filter

Hi, I have 3 columns created in a master table called 'Patients' all rows are at patient level. For this example, we label the columns as A, B and C of which contains either Yes or No alongside their respective unique patientID.

I wish to build a 4th column D in the Patients table (again returning Yes or No) using the logic below

 

Column D = Patients in A plus Patients in B minus Patients in C.

 

Can you assist?

Josh 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jos818 ,
Please try the below logic for your calculated column:

Group D = IF(('table'[Group A] = "Yes" || 'table'[Group B] = "Yes" ) && 'table'[Group C] = "No", "Yes", "No")

Below is the result:
aabadalwar_1-1687430872070.png


Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

 

View solution in original post

3 REPLIES 3
v-jianboli-msft
Community Support
Community Support

Hi @jos818 ,

 

Please try:

D = IF([A]="Yes"&&[B]="Yes"&&[C]="Yes","Yes","No")

Final output:

vjianbolimsft_0-1687421929173.png

 

Best Regards,

Jianbo Li

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

apologies I can see the confusion. To clarify the ask with dummy numbers as follows.
I wish to create group D whereby they are either in group A or group B and not in group C.

eg. group A has 2000 patients, group B has 5000 patients, group C has 4000 patients. so group D will only return 3000 patients (with yeses) 

Anonymous
Not applicable

Hi @jos818 ,
Please try the below logic for your calculated column:

Group D = IF(('table'[Group A] = "Yes" || 'table'[Group B] = "Yes" ) && 'table'[Group C] = "No", "Yes", "No")

Below is the result:
aabadalwar_1-1687430872070.png


Give a Thumbs Up if this post helped you in any way and Mark This Post as Solution if it solved your query !!!

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors