Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago

Tables with no relationship

 

In the below DAX code getting the following error :

 

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

 

 

 

All = 
Var N1 = convert(SELECTEDVALUE('slicer1'[datetime1]), DATETIME)

var Result = SUMMARIZECOLUMNS( table1[code1], table1[text1], "All", 
CALCULATE( COUNTROWS(table2), FILTER( table2, table2[datetime2] <= N1 
&& (ISBLANK(table2[col1]) || table2[col1] > N1) 
&& (ISBLANK(table2[col2]) || table2[col2] > N1) 
&& table2[code2] = RELATED(table1[code1] ) ) ) )

return Result

 

 

There is no relation between two tables.

The desire result which I want to get is a table with three columns: code1, text1, All

 

Any idea what should I change in DAX code for this error?

1 Reply