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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Summarize error with The express refers to multiple columns.

Hi,

 

I am trying to build a table of EMP headcounts based of their Hours working group,. The dataset is like;

 

Job                                      EMP Names                                        Total

Civil                                     James                                                  200

Civil                                    Paul                                                      2000

Pipe                                    Paul                                                      4000

Pipe                                    Troy                                                     700

Market                               Tom                                                      500

 

I have;

  • Table: Append1
  • Column 1: Append1[JOB] 
  • Column 2: Append1[Employee Name]
  • Column 3: Append1[Total]  - Actual work hours

And below is the folmula that I am using;

 

Experience Table = summarize(Append1,Append1[JOB],Append1[Employee Name],"0 to 250",Calculate(distinctcount(Append1[Employee Name]),Filter(Append1,Append1[Total]<=250)),"500 to 1000",Calculate(distinctcount(Append1[Employee Name]),Filter(Append1,And(Append1[Total]>250,Append1[Total]<=500))),"1000 to 2000",Calculate(distinctcount(Append1[Employee Name]),Filter(Append1, And(Append1[Total]>1000,Append1[Total]<=2000))),"2000 to 4000",Calculate(distinctcount(Append1[Employee Name]),Filter(Append1, And(Append1[Total]>2000,Append1[Total]<=4000))),"Over 4000",Calculate(distinctcount(Append1[Employee Name]),Filter(Append1,Append1[Total]>4000)))
 
 
And my end result that I want is;
 
JOB                 >250     250 to 500     500 to 1000      1000 to 2000      2000 to 4000       >4000
Civil                    1               0                    0                        1                          0                      0
Pipe                    0               0                    1                        0                          1                      0
Market                0              1                      0                      0                          0                      0
 
 
 
I am trying to find out why it comes up with error; "The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.
 
Pleas help.
 
Thank you,

 

2 ACCEPTED SOLUTIONS
amitchandak
Super User
Super User

@Anonymous 

If you are not doing any aggregation on Append1[Total].

Create a new column in the append table and use it?

Bucket =

Switch(true(),
Append1[Total]<=250,"0 to 250",
Append1[Total]<=500,"250 to 550",
Append1[Total]<=1000,"500 to 1000",
Append1[Total]<=2000,"1000 to 2000",
Append1[Total]<=2000,"2000 to 4000",
"Over 4000"
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You need to Create a calculated table not column or measure.

 

Community Support Team _ Sam Zha
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

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@Anonymous 

 

You need to Create a calculated table not column or measure.

 

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
amitchandak
Super User
Super User

@Anonymous 

If you are not doing any aggregation on Append1[Total].

Create a new column in the append table and use it?

Bucket =

Switch(true(),
Append1[Total]<=250,"0 to 250",
Append1[Total]<=500,"250 to 550",
Append1[Total]<=1000,"500 to 1000",
Append1[Total]<=2000,"1000 to 2000",
Append1[Total]<=2000,"2000 to 4000",
"Over 4000"
)

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.