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

DAX filter where text in two columns is the same

Hello, 

 

I have a problem where as a filter there where the text in two distinct columns is the same then it stays in the filter. I have tried X =Y and I cannot add the second measure. is there a dax where I can do this?

1 ACCEPTED SOLUTION
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.Create a calculated column to determine whether it matches.

T/F = 
IF (
    SUMX (
        'Table (2)',
        FIND ( UPPER ( 'Table (2)'[fruit] ), UPPER ( 'Table'[fruit] ),, 0 )
    ) > 0,
    "True","False"
)

1.png

 

2.The result is as follows.

2.png

 

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

4 REPLIES 4
v-stephen-msft
Community Support
Community Support

Hi @Anonymous ,

 

1.Create a calculated column to determine whether it matches.

T/F = 
IF (
    SUMX (
        'Table (2)',
        FIND ( UPPER ( 'Table (2)'[fruit] ), UPPER ( 'Table'[fruit] ),, 0 )
    ) > 0,
    "True","False"
)

1.png

 

2.The result is as follows.

2.png

 

 

You can check more details from here.

 

 

Best Regards,

Stephen Tao

 

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

Greg_Deckler
Super User
Super User

@Anonymous - Not sure, sample data might help, but can you create a measure like this?

 

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

 

Then filter on 1?

 

Otherwise, Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.


@ 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

@Anonymous , The information you have provided is not making the problem clear to me. Can you please explain with an example.

 

Couple of examples of possible filter

calculate([Measure], filter(Table, Table[col1] =Table[Col2]))

calculate([Measure], filter(Table, Table[col1] =Max(Table2[Col1])))


Appreciate your Kudos.


Anonymous
Not applicable

For example in one table (call this 'Table'[fruit]) there is :

apple
banana
pear 
orange
lemon
 

 

And a second table 'Table2'[fruit]:

apple
kiwi
satsuma
lemon

 

I need to return results from table one where there is exact text match between the two 

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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