Forum Discussion

shabby010's avatar
shabby010
New Member
3 years ago

Expression.Error: We cannot apply field access to the type Number. Details: Value=1 Key=Cust

and this is the query i am using

= Table.AddColumn(#"Replaced Value", "TotalFirstInvoice", each if [Custom.Index] = 1 [Custom.Type] <> "Revenue" then [Custom.Invoice Value] else 0)

3 Replies

  • are you missing the "and" keyword?

     

    = Table.AddColumn(#"Replaced Value", "TotalFirstInvoice", each if [Custom.Index] = 1 and [Custom.Type] <> "Revenue" then [Custom.Invoice Value] else 0)

    • shabby010's avatar
      shabby010
      New Member

      No i used the and operator

       

      = Table.AddColumn(#"Replaced Value", "TotalFirstInvoice", each if [Custom.Index] = 1  &  [Custom.Type] = " Revenue " then [Custom.Invoice Value] else 0)

      • lbendlin's avatar
        lbendlin
        Super User

        there is no "and operator" in Power Query. The  &  sign is used to concatenate objects.  You need to use the actual word "and" for conditionals.