Forum Discussion
Anonymous
1 year agoNot applicable
without relationship table
All, I have two tables, table 2 'discount' amount should populate in table 1 using DAX Formula, please suggest. don't want create relationship or merge two tables because data is huge size. ...
- Anonymous1 year ago
Hi Anonymous ,
Thanks for the update totally understand that you're working with large data and can't share the file.
If creating a relationship is giving you an ambiguous relationship error, that usually means there are multiple paths between the two tables maybe through some other common table or field in the model. Since you're avoiding relationships altogether, the LOOKUPVALUE approach should still work if the values in Region and Quarter match exactly between the two tables (including no extra spaces or case mismatches).
Here’s a quick checklist to make sure the LOOKUPVALUE works as expected:
- Double check for any leading/trailing spaces in Region or Quarter columns in both tables.
You can try adding TRIM() or use Power Query to clean text if needed. - Make sure the combination of Region and Quarter is unique in the discount table if there are duplicates, LOOKUPVALUE might not behave consistently.
- Use this revised formula as a calculated column in Table1.
Discount =
VAR _region = TRIM(Table1[Region])
VAR _quarter = TRIM(Table1[Quarter])
RETURN
LOOKUPVALUE(Table2[Discount],Table2[Region], _region,Table2[Quarter], _quarter)Let me know how this goes, happy to help further if it still acts up.
Regards,
Akhil. - Double check for any leading/trailing spaces in Region or Quarter columns in both tables.
Ashish_Mathur
11 months agoSuper User
Hi,
This calculated column formula works
=CALCULATE(SUM(Table2[discount]),FILTER(Table2,Table2[Region]=EARLIER(Table1[Region])&&Table2[quarter]=EARLIER(Table1[quarter])))
Hope this helps.