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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.