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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
chonchar
Helper V
Helper V

Matching Text

Hello,

 

I am trying to perform a four-way match from four different tables. The problem is that I am trying to match text rather than numbers. I beleive the below DAX would work for numbers, but it will not work for text.

 

Match/No Match =

VAR MatchFake1 = SELECTEDVALUE('XX Line Staging'[XX Staging Item Deescription])

VAR MatchFake2 = SELECTEDVALUE('XX Lines'[Item Description])

VAR MatchFake3 = SELECTEDVALUE(Items[Item Description])

VAR MatchFake4 = SELECTEDVALUE('Order Lines'[Item Description])

Return

IF(MatchFake1=MatchFake2=MatchFake3=MatchFake4, "Match", "No Match"

)

 

Please keep in mind I am searching for a 4-way match on text so I can create a conditionally formatted column to populate match/no match in a KPI card in PBI. 

 

Any feedback would be great. Thank you,

 

Cam

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@chonchar Add as a measure:

 

Match/No Match Measure = 
VAR __Count = 
COUNTROWS ( 
   DISTINCT ( { 
        SELECTEDVALUE ( Table[Desc1] ), 
        SELECTEDVALUE ( Table[Desc2] ), 
        SELECTEDVALUE ( Table[Desc3] ), 
        SELECTEDVALUE ( Table[Desc4] ) 
} ) )
RETURN
IF ( __Count = 1, "Match", "No Match" )

 

👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@chonchar Add as a measure:

 

Match/No Match Measure = 
VAR __Count = 
COUNTROWS ( 
   DISTINCT ( { 
        SELECTEDVALUE ( Table[Desc1] ), 
        SELECTEDVALUE ( Table[Desc2] ), 
        SELECTEDVALUE ( Table[Desc3] ), 
        SELECTEDVALUE ( Table[Desc4] ) 
} ) )
RETURN
IF ( __Count = 1, "Match", "No Match" )

 

👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@chonchar add a new column with following DAX expression:

 

Match/No Match Column = 
VAR __Count = COUNTROWS ( DISTINCT ( { Table[Desc1], Table[Desc2], Table[Desc3], Table[Desc4] } ) )
RETURN
IF ( __Count = 1, "Match", "No Match" )

 

👉 Learn Power BI and Fabric - subscribe to our YT channel - @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤️



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

I completely understand the sytnax, but PBI is not populating the other tables after: 

Table[Column1]. Is there something I am missing? does distinct not pull table1[column1], table2[column2]...etc?

@parry2k do I need to create measures for each table column? It is only pulling  measures with that syntax. 

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.