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

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

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.