Forum Discussion

balaganeshmohan's avatar
3 years ago
Solved

The expression refers to multiple columns. Multiple columns cannot be converted to a scalar value.

I am trying to use ADDCOLUMNS on an existing measure that is to be filtered by date and location from two different tables. But I am not sure if this the right way to do it as I am stuck with the error code in the title. Here is my code. Seeking some help to fix this. Thank you!

 

VAR Sales =
ADDCOLUMNS (
ALLSELECTED ( 'Item'[No_] ),
"NetRev",
CALCULATE (
[Expected Net Revenue],
ALL ( 'Date' ),
'Date'[FY YEAR] = FiscalYear
 && ALL ( 'sku_forecast' ), 'sku_forecast'[location] = LocName
 )
 )

 

  • Hi balaganeshmohan ,

    Your DAX will return a table with multi columns, it couldn't be a measure.

    And if you want to use a measure ,could you share your sample data and expect output?

     

     

     

    Best Regards

    Lucien

2 Replies

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi balaganeshmohan ,

    Your DAX will return a table with multi columns, it couldn't be a measure.

    And if you want to use a measure ,could you share your sample data and expect output?

     

     

     

    Best Regards

    Lucien

  • v-luwang-msft's avatar
    v-luwang-msft
    Community Support

    Hi  balaganeshmohan ,

    Has your problem been solved, if so, please consider Accept a correct reply as the solution or share your own solution to help others find it.

    Best Regards
    Lucien