Add a custom column in Power Query by multiplying another column in a table with no relationship.

Juliana Zhou 21 Reputation points
2023-02-23T15:08:57.5633333+00:00

It throws an error when I add a custom column in Power Query by multiplying another column in a table with no relationship.

Expression.Error: We cannot apply operator * to types Number and List.
Details:
    Operator=*
    Left=0
    Right=[List]
Community Center Not monitored
0 comments No comments
{count} votes

1 answer

Sort by: Most helpful
  1. Alan Farias 755 Reputation points
    2023-02-24T23:19:31.11+00:00

    The error message suggests that you are trying to multiply a number with a list in your custom column expression. This is not a valid operation, hence the error.

    To fix this error, you need to ensure that the expression in your custom column is only multiplying numbers with numbers, and not any other data types. Here's an example of an expression that multiplies two columns together:

    = Table.AddColumn(Source, "CustomColumn", each [Column1] * [Column2])
    

    In this example, Column1 and Column2 are both numeric columns in the Source table, and we're multiplying them together to create a new custom column called CustomColumn.

    If you're still getting the same error, double-check that the data types of the columns you're working with are correct. It's possible that one of the columns is not actually numeric, but rather a list or another data type.

    1 person found this answer helpful.

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.