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
Durbslaw
Helper I
Helper I

Error Multiple columns cannot convert to scalar value

Hi,

 

I have this measure...

 

Day1LeaveCatergory = countx(Summarize('Leave Management',"Leave Day Catergory",FILTER('Leave Management','Leave Management'[DateDiff] = "1-Day")),[DateDiff])
 
which is meant to count the "1-Day" occurences in the DateDiff measure, I get the Expression refers to muliple columns. Multiple columns cannot convert to a scalar error.
 
Many thanks for the reads and responses.
 
Regards
1 ACCEPTED SOLUTION
v-chenwuz-msft
Community Support
Community Support

Hi @Durbslaw ,

 

The problem is that you are using summarize() incorrectly.

 

SUMMARIZE (<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…)

 

In your code,

1 you have missed one necessary argument <groupBy_columnName>.

<expression> should return a value rather than a table, the return of FILTER() is a table so that the error message.

 

Maybe you can try this expression to count the "1-Day".

COUNTROWS( FILTER('Leave Management','Leave Management'[DateDiff] = "1-Day"))

 

Or please share some example data and expect result if you need more help.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-chenwuz-msft
Community Support
Community Support

Hi @Durbslaw ,

 

The problem is that you are using summarize() incorrectly.

 

SUMMARIZE (<table>, <groupBy_columnName>[, <groupBy_columnName>]…[, <name>, <expression>]…)

 

In your code,

1 you have missed one necessary argument <groupBy_columnName>.

<expression> should return a value rather than a table, the return of FILTER() is a table so that the error message.

 

Maybe you can try this expression to count the "1-Day".

COUNTROWS( FILTER('Leave Management','Leave Management'[DateDiff] = "1-Day"))

 

Or please share some example data and expect result if you need more help.

 

Best Regards

Community Support Team _ chenwu zhu

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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.