Forum Discussion

RanjanThammaiah's avatar
6 years ago
Solved

DAX Error: The Expression Refers to Multiple Columns. Multiple Columns Cannot Be Converted to a Scal

Hi All,

 

i am getting the error for the below formula. Kindly can some one explain me what this error referring to?

DAX Error: The Expression Refers to Multiple Columns. Multiple Columns Cannot Be Converted to a Scalar Value.

Measure 2 = CALCULATE(FILTER(SLI,SUM(SLI[TERFYTD_PR])>41666))

 

 
  • Hi RanjanThammaiah ,

     

    Your DAX will return a table with multi columns, it couldn't be a measure. If you want a measure, you need add your expression before filter. If you want a table, you could use CALCULATETABLE() function to create a new table.

    Table 2 = 
    CALCULATETABLE(FILTER('SLI',SUM('SLI'[TERFYTD_PR])>4))

    To avoid misunderstandings, you could elaborate on your expected results and calculation logic.

     

3 Replies

  • ImkeF's avatar
    ImkeF
    Community Champion

    Hi RanjanThammaiah 

    you're missing the first argument of the CALCULATE-function, which would be some sort of an aggregation. (The aggregation of the actual value/column that you want to show in the values-section of your visual)

    Like so i.e.:

     

    Measure 2 = CALCULATE( SUM(MyFactTable[Amount] ), FILTER(SLI,SUM(SLI[TERFYTD_PR])>41666) )

     

  • Try like

    Measure 2 = CALCULATE(countrows(FILTER(SLI,SUM(SLI[TERFYTD_PR])>41666)))

     

    But what exactly you are trying to achieve, measure filter needs a context.

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

    Hi RanjanThammaiah ,

     

    Your DAX will return a table with multi columns, it couldn't be a measure. If you want a measure, you need add your expression before filter. If you want a table, you could use CALCULATETABLE() function to create a new table.

    Table 2 = 
    CALCULATETABLE(FILTER('SLI',SUM('SLI'[TERFYTD_PR])>4))

    To avoid misunderstandings, you could elaborate on your expected results and calculation logic.