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
Anonymous
Not applicable

Formatting a column value based on other two column value

Hello All,

 

I have table which has two columns(Column-1 and Cloumn-2): I want to have another cloumn(let's say Column-3) which should have:

 

  • If cloumn-1 is No AND cloumn-2 is No then the cloumn-3 value should be RED and background colur should be RED.
  • If cloumn-1 is No AND cloumn-2 is Yes then the cloumn-3 value should be AMBER and background colur should be AMBER.
  • If cloumn-1 is Yes AND cloumn-2 is No then the cloumn-3 value should be AMBER and background colur should be AMBER.
  • If cloumn-1 is Yes AND cloumn-2 is Yes then the cloumn-3 value should be GREEN and background colur should be GREEN.

 

Thanks for your support.

1 ACCEPTED SOLUTION
DataVitalizer
Solution Sage
Solution Sage

Hi @Anonymous 

Create a new calculated column using this DAX

Column3 = 
SWITCH(TRUE(),AND('Table'[cloumn-1]="No",'Table'[cloumn-2]="No"),"RED",OR(AND('Table'[cloumn-1]="No",'Table'[cloumn-2]="Yes"),AND('Table'[cloumn-1]="Yes",'Table'[cloumn-2]="No")),"AMBER","GREEN")
 

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated  

View solution in original post

3 REPLIES 3
DataVitalizer
Solution Sage
Solution Sage

Hi @Anonymous 

Create a new calculated column using this DAX

Column3 = 
SWITCH(TRUE(),AND('Table'[cloumn-1]="No",'Table'[cloumn-2]="No"),"RED",OR(AND('Table'[cloumn-1]="No",'Table'[cloumn-2]="Yes"),AND('Table'[cloumn-1]="Yes",'Table'[cloumn-2]="No")),"AMBER","GREEN")
 

Did it work ? Mark it as a solution to help spreading knowledge.

A kudos would be appreciated  

Anonymous
Not applicable

Thanks very much. It worked.:)

You are welcome 👍

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