Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Hayoung
Helper IV
Helper IV

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 1
AllisonKennedy
Super User
Super User

  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] )
)
)

 

 

 

AllisonKennedy_1-1676445016681.png

AllisonKennedy_0-1676444876713.png

@Hayoung


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.