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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
L1102
Helper I
Helper I

The Expression Refers To Multiple Columns. Multiple Columns Cannot Be Converted To A Scalar Value.

Hi All,

 

I'm looking to calculate 4 tables that list items based on a conbination of conditions based on 2 different averages. Depending on my </> condition will be dependent on what table the items will fall in. Below is what I put in for the first table, but was return with the error mentioned in above. Your help is greatly appriciated.

 

Red Flag =
VAR AVGSPPD = AVERAGE(Data_Table[$ SPPD])
VAR AVGWTD = AVERAGE(Data_Table[Wghtd Dist])

RETURN
CALCULATETABLE(Data_Table,Data_Table[$ SPPD]<AVGSPPD,Data_Table[Wghtd Dist]>AVGWTD)
1 ACCEPTED SOLUTION
FBergamaschi
Solution Sage
Solution Sage

You must be by mistake being creating a measure

 

A measure cannot return a table, you should create a new table (Modeling -> New Table) 

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

View solution in original post

5 REPLIES 5
FBergamaschi
Solution Sage
Solution Sage

You must be by mistake being creating a measure

 

A measure cannot return a table, you should create a new table (Modeling -> New Table) 

 

If this helped, please consider giving kudos and mark as a solution

@me in replies or I'll lose your thread

Want to check your DAX skills? Answer my biweekly DAX challenges on the kubisco Linkedin page

Consider voting this Power BI idea

Francesco Bergamaschi

MBA, M.Eng, M.Econ, Professor of BI

So embarrasing... this is exactly what was happening.

Zanqueta
Solution Sage
Solution Sage

Hello @L1102,

 

The error “The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value” occurs because within CALCULATETABLE you are attempting to use expressions such as Data_Table[$ SPPD] < AVGSPPD directly. This returns an entire column rather than a logical value for each row.
In DAX, when filtering a table, you need to use functions that evaluate row by row, such as FILTER().
 
Could you try adpation you code would look like this:
 
 
Red Flag =
VAR AVGSPPD = AVERAGE(Data_Table[$ SPPD])
VAR AVGWTD = AVERAGE(Data_Table[Wghtd Dist])
RETURN
CALCULATETABLE(
    Data_Table,
    FILTER(
        Data_Table,
        Data_Table[$ SPPD] < AVGSPPD &&
        Data_Table[Wghtd Dist] > AVGWTD
    )
)

 

If this response was helpful in any way, I’d gladly accept a 👍much like the joy of seeing a DAX measure work first time without needing another FILTER.

Please mark it as the correct solution. It helps other community members find their way faster (and saves them from another endless loop 🌀.

Hi @Zanqueta ,

 

I tried the FILTER expression earlier this morning and it returned the same error.

L1102_0-1764863877693.png

 

GeraldGEmerick
Memorable Member
Memorable Member

@L1102 Measures and calculated columns cannot return a table. Only calculated tables can return a table. So your RETURN statement where you are using CALCULATETABLE, that returns a table. You could instead use CALCULATE to return a scalar (single number/text).

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.