Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Create a Calculated Column from Different Tables

I am using DirectQuery storage mode. I have a table where I want to create a new column using two columns already present in my table. However, those two columns come from different tables.

Using DIVIDE('table1'[col1], 'table2'[col2]) I am always thrown an error like "A single value for column 'col1' in table 'table1' 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." Each table has 8 rows and I filter so that I am really only trying to calculate a column of 4 rows. Specifying SUM returns the errors "Function 'SUM' is not allowed as part of calculated column DAX expressions on DirectQuery models."

I am guessing I need to create a distinct key for each table (say 1-8) and create a new relationship between the two tables I am using? I'm not sure what else to try.

4 Replies