Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Custom column that multiplies values from a column based on specific values from another column

Hi all, 

I am new to PowerBI but want transform over an Excel quote. I wanted to create a custom column "Dispatched Qty", that multiples "Quantity Shipped" value by a factor, if  "client_sku_id" has a specific value. i.e if it is 1000167, then multiple by 10, if 1000219, then multiple by 25. Below is the example table preview. 

 

client_sku_idQuantity ShippedDispatched Qty
10001672002000
1000764120600
1000220315
10002198200

 

I have had an attempt at this, I think I am almost there but it just appears as FALSE in the new column. Here are my workings:

 

if([client_sku_id])="1000219" then ([Quantity Shipped])*25  else if  ([client_sku_id])="1000167" then ([Quantity Shipped])*10 else if ([client_sku_id])="1000220" then ([Quantity Shipped])*5 else if ([client_sku_id])="1000764" then ([Quantity Shipped])*5 else false

  • Anonymous  values in your quantity shipped column are numbers while "1000167" etc. is text

2 Replies

  • Anonymous  values in your quantity shipped column are numbers while "1000167" etc. is text

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you. Yes removing the quotation marks detected it as a number . School-boy error!