Forum Discussion
tonyc
2 years agoFrequent Visitor
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
I received this error message, and I'm unable to solve it. Any help would be greatly appreciated.
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
Here is my measure code -
Test1 =
VAR FilteredData =
FILTER(
'Details',
'Details'[Status] IN { "Active" , "Merging" } &&
'Details'[Type]="ABC" &&
'Details'[Fact] IN { "A" , "B", "C" }
)
RETURN
SELECTCOLUMNS(
FilteredData,
"Code", 'Details'[Code],
"Name", 'Details'[Name]
)
2 Replies
- HotChilliCommunity Champion
Test1 is a measure so it should return a scalar (single) value but SELECTCOLUMNS returns a table.
- VahidDMSuper User
Hi tonyc
The output of your expression will be a table (SELECTCOLUMNS) so you can't use it in Measure or calc columns without any aggregation.
Please read this:
https://www.sqlgene.com/2019/04/30/dax-error-the-expression-refers-to-multiple-columns-multiple-columns-cannot-be-converted-to-a-scalar-value/If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!