Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I created a calculated column on TableA:
Years = IF('TableA'[Div] = "AA1", 1, DATEDIFF('TableA'[StarDate], TODAY(), Year))
A I want to get the above value on TableB:
YearsRef = 'TableA'[Years]
But got an error like that:
A single value for column 'xxxxx' in table 'xxxxxx' 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.
Any advice please to solve that?
Thanks in advance,
Vadi
It depends on the relationship between Tables A and B. If Table A is on the 1 side, you can use RELATED('TableA'[Years]). If reversed, you can use RELATEDTABLE() and an aggregation function like MIN() to get to your result. You can also use LOOKUPVALUE(), in many situation or if no relationship at all.
You should also consider doing what you need with measures instead of calculated columns. Much of what is done in columns should be done in measures.
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
To learn more about Power BI, follow me on Twitter or subscribe on YouTube.
Hi Pat,
Thank you for your advice.
There is no relationship between two tables and I can make a relationship many to many only.
Years column has values on TableA like the following:
1
1
8
I want to get these same values on TableB.
Thank you,
Vadi
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
55 | |
27 | |
23 | |
14 | |
11 |
User | Count |
---|---|
78 | |
63 | |
46 | |
17 | |
12 |