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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
TERRY_HUGHES
Frequent Visitor

Compare 2 text columns in different (related) tables produces AGGRIGATE error


We have 2 different systems used to track inventory locations and want to show in PBI if they are varient or not. The two tables are related via a PRODUCT_KEY so it seem's like it should be a simple no brainer to just compare the location values with a measure: 

MyMeasure = If(SystemATable[Location]=SystemBTable[Location],"Yes","No")



PBi returns:
A single value for column 'LOCATION' in table 'SystemATable' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result.

I've googled the heck out of this and have tried using RELATED, RELATEDTABLE, EXACT, SWITCH, setting up the compared values as VARiables, etc ad nausium and either I get the tiresome aggrigate error

It would be a lot of work to merge these tables together to create a calculated column so I'd like to do with with a dax measure, is it possible? Seems like it would be easy peasy but nooooooooo 😞


 

1 ACCEPTED SOLUTION
TERRY_HUGHES
Frequent Visitor

@tamerj1 Got me closer!

Measure = IF(Values(TableA[Column]) = Values(TableB[Column]), "yes", "no")) 

worked, VALUES being the text aggregate. Thank you!

View solution in original post

2 REPLIES 2
TERRY_HUGHES
Frequent Visitor

@tamerj1 Got me closer!

Measure = IF(Values(TableA[Column]) = Values(TableB[Column]), "yes", "no")) 

worked, VALUES being the text aggregate. Thank you!

tamerj1
Super User
Super User

Hi @TERRY_HUGHES 

it depends on your requirement

you may try

MyMeasure =
IF (
    SystemATable[Location] IN RELATEDTABLE ( VALUES ( SystemBTable[Location] ) ),
    "Yes",
    "No"
)

 Or

MyMeasure =
IF (
    SystemATable[Location] IN VALUES ( SystemBTable[Location] ),
    "Yes",
    "No"
)

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.