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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
spaturu3234
Frequent Visitor

How can I compare three columns in DAX

I Have three calculated columns X,Y,Z

 

I need to compare X=Y=Z and flag them if they are not equal 

 

I can do by creating a three different columns agian  like

X=Y

Y=Z

X=Z

 

If all have true then TRUE

 

But, Is there any easy way to do it in DAX ?

1 ACCEPTED SOLUTION
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @spaturu3234,

You just need to create a calculated column using the formula.

Flag = IF(Table4[Column1]=Table4[Column2]&&Table4[Column2]=Table4[Column3]&&Table4[Column1]=Table4[Column3],"True","False")


I create a sample table and test it, please see the result below.

1.PNG

Best Regards,
Angelia

View solution in original post

2 REPLIES 2
v-huizhn-msft
Microsoft Employee
Microsoft Employee

Hi @spaturu3234,

You just need to create a calculated column using the formula.

Flag = IF(Table4[Column1]=Table4[Column2]&&Table4[Column2]=Table4[Column3]&&Table4[Column1]=Table4[Column3],"True","False")


I create a sample table and test it, please see the result below.

1.PNG

Best Regards,
Angelia

Vvelarde
Community Champion
Community Champion

@spaturu3234

 

NewColumn = Table1[Column1]=Table1[Column2] && Table1[Column1]=Table1[Column3] && Table1[Column2]=Table1[Column3]




Lima - Peru

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

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.