cancel
Showing results for 
Search instead for 
Did you mean: 
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
Microsoft

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
Microsoft

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

Vvelarde
Community Champion
Community Champion

@spaturu3234

 

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




Lima - Peru

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Power BI December 2021 Update_carousel 768x460.jpg

Check it Out!

Click here to read more about the December 2021 Updates!

Jan 2022 Dev Camp 768x460 copy.png

Power BI Dev Camp- January 27th, 2022

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors