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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Related function - Count specific amount of values

Hello, I am comparing customer names from two different columns to find any mismatches. I am using the following formula:

 

MismatchCusName = IF (
'SRC_Customers'[CUSTOMER_NAME] = RELATED ( 'ECS_EZQuery44'[Customer_Name]),
"Match",
"Mismatch")
 
The problem is that one of the columns does not have the complete name (limited amount of characters) and this gives me a mismatch. For example: The name in one column is complete - Baseball Academy Carlos Ortiz C.A.  / The name on the other column is limited: Baseball Academy Carlos Ort
 
Is there a way to use the related function to count only the first 12 characters from the customer name tables, and compare them to see if they match?
1 ACCEPTED SOLUTION

HI  @Anonymous 

You just need to adjust the formula as below:

LEFT(RELATED ('ECS_EZQuery44'[Customer_Name]), 12)

MismatchCusName = IF (
(LEFT('SRC_Customers'[CUSTOMER_NAME],12)) = LEFT(RELATED ('ECS_EZQuery44'[Customer_Name]), 12),
"Match",
"Mismatch")

 

Regards,

Lin

Community Support Team _ Lin
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

3 REPLIES 3
amitchandak
Super User
Super User

Check if you can use mid/left  function in comparison

 

left(table[name],12)

 

Appreciate your Kudos. In case, this is the solution you are looking for, mark it as the Solution.
In case it does not help, please provide additional information and mark me with @

Thanks. My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP, HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Datanaut Connect on Linkedin

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

MismatchCusName = IF (
(LEFT('SRC_Customers'[CUSTOMER_NAME],12)) = RELATED (LEFT('ECS_EZQuery44'[Customer_Name], 12)),
"Match",
"Mismatch")
 
Thank you, I get the following error.
Function RELATED expects a fully qualified column reference as its argument. 

HI  @Anonymous 

You just need to adjust the formula as below:

LEFT(RELATED ('ECS_EZQuery44'[Customer_Name]), 12)

MismatchCusName = IF (
(LEFT('SRC_Customers'[CUSTOMER_NAME],12)) = LEFT(RELATED ('ECS_EZQuery44'[Customer_Name]), 12),
"Match",
"Mismatch")

 

Regards,

Lin

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

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.