Forum Discussion
Anonymous
4 years agoNot applicable
Calculated columns single value cannot be determined (Microsoft PowerBI tutorial)
I'm following the Microsoft tutorial for PowerBI, specifically: https://docs.microsoft.com/en-gb/learn/modules/model-data-power-bi/3-create-calculated-columns
Where it asks to create "the new CountryZip calculated column in the Geography table and the Sales table", using the formula:
"CountryZip = Geography[Country] & ", " & Geography[Zip]", this works fine for the Geography table, but in the Sales table it displays the error message:
"A single value for column 'Country' in table 'Geography' 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." (see screenshot below)
Also, if I edit the formula so that it is "CountryZip = Geography[Zip]", then therere is the same error but for column 'Zip'.
Any help with this question would be greatly appreciated!
If there is a one-to-many relationship from Geography to Sales then in the Sales table you could use the RELATED function to get a value from Geography, so you could add a column to Sales like
CountryZip = RELATED(Geography[Country]) & ", " & RELATED(Geography[Zip])
1 Reply
- johnt75Super User
If there is a one-to-many relationship from Geography to Sales then in the Sales table you could use the RELATED function to get a value from Geography, so you could add a column to Sales like
CountryZip = RELATED(Geography[Country]) & ", " & RELATED(Geography[Zip])