Forum Discussion
Custom column that multiplies values from a column based on specific values from another column
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_id | Quantity Shipped | Dispatched Qty |
| 1000167 | 200 | 2000 |
| 1000764 | 120 | 600 |
| 1000220 | 3 | 15 |
| 1000219 | 8 | 200 |
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
- AlienSxSuper User
Anonymous values in your quantity shipped column are numbers while "1000167" etc. is text
- AnonymousNot applicable
Thank you. Yes removing the quotation marks detected it as a number . School-boy error!