Forum Discussion
Anonymous
3 years agoNot applicable
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
I have created measure:
Q3 TEST3 = CALCULATE(COUNTROWS ('Q3'),FILTER(FILTER(Q3,Q3[Facility Name]=SELECTEDVALUE(Demographics[Facility Name])),ALLEXCEPT(Q3,Q3[Gender])))
It pop up the error:
The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
Anyone know how should i modify?
1 Reply
- AllisonKennedy
Community Champion
What are you trying to achieve?
You have used the FILTER function twice. The filter argument in the filter function should be a true / false expression - you've used a calculate modifier ALLEXCEPT which can only be used in the calculate function.
Here's your expression formatted using DAXformatter.com to make it more clear:
Try either:
Q3 TEST3 =
CALCULATE (
COUNTROWS ( 'Q3' ),
FILTER ( Q3, Q3[Facility Name] = SELECTEDVALUE ( Demographics[Facility Name] ) ),
ALLEXCEPT ( Q3, Q3[Gender] )
)Or try:
Q3 TEST3 =
CALCULATE (
COUNTROWS ( 'Q3' ),
FILTER (
ALLEXCEPT ( Q3, Q3[Gender] ),
Q3[Facility Name] = SELECTEDVALUE ( Demographics[Facility Name] )
)
)Anonymous