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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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
Super User
Super User

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
Super User
Super User

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
Super User
Super User

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 🌀.

If this response was helpful in any way, I’d gladly accept a kudo.
Please mark it as the correct solution. It helps other community members find their way faster.
Connect with me on LinkedIn

Hi @Zanqueta ,

 

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

L1102_0-1764863877693.png

 

GeraldGEmerick
Super User
Super User

@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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.