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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
tim_m15
Resolver I
Resolver I

IF two Columns in Table have the same content / figures then output TRUE

Hello everyone,

 

I want to create a Filter-Measure, that output "1", if two specific columns in my table have same values in the same row.

 

For example:

 

No. | Article |             X         |             Y          |  output filter measure |

-----------------------------------------------------------------------------

1     | A         |     account 45 |   account 70    |   0   |

2     | B         |     account 2   |    account 2     |   1   |

3     | C         |     account 90 |    account 500 |   0   |

4     | D         |     account 7   |   account 7     |    1   |

 

 

In this example, my filter-measure should return "1" in line 2 and line 4 because the content in line 2 in column "X" is the same as well as in column "Y" (account 2). The same logic for line 4 (account 7)

 

Thanks for advice on how I can solve this.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

@tim_m15 Well, try:

 

Column = IF([X] = [Y],1,0)

Measure = IF(MAX([X]) = MAX([Y]),1,0)

 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Super User
Super User

@tim_m15 Well, try:

 

Column = IF([X] = [Y],1,0)

Measure = IF(MAX([X]) = MAX([Y]),1,0)

 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
amitchandak
Super User
Super User

@tim_m15 , a snew column this should work ?

if([X] =[Y],1,0)

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.