Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

function expects table expression for argument '2', but a string or numeric expression...

I just need some tips on what to do that would work in this situation if I can't use an if statement.   I have the below column in Power BI Desktop which is creating the error, "the function expect...
  • d_gosbell's avatar
    7 years ago

    I can't see how you would be getting that error from that expression.

     

    What table are you creating this column in and how is that table related to the PS_PP table? You obviously cannot be creating this column in the PS_PP table as you are attempting to call SUM(PS_PP[Sales]) and that would create a circular reference error not the "expects a table expression" error.

     

    If you try a simple if like the following does that work?

     

    Sales = if(PS_PP[Grp Desc] = "Comm Acctble" , 0, 1)

     

    If so that would point to this issue coming from one of the SUM calls somehow.