Forum Discussion
Anonymous
6 years agoNot applicable
Automatically multiplying data based on individual row values
Hi All, I'm pretty new to Power Bi and still getting to grips with DAX expressions and the like, hoping for some guidance on something that's got me pulling my hair out ATM! Here is a s...
- 6 years ago
Hi,
This is the kind of calculation you should be doing in a calculated column. Assuming you have a column for Product, try this calculated column formula
=IF(Data[SKU]="2163986-5",IF(Data[Product]="Sour Apple",Data[Qty]*5,Data[Qty]),Data[Qty])
Hope this helps.
Anonymous
6 years agoNot applicable
Hi Ashish_Mathur ,
Thanks this seems to be working, the only problem I'm having is when I want to add a 2nd, 3rd, 4th etc. expression to the column they seem to interfere with each other (most likely a novice mistake on my part) Here is how I have structured it:
TotalSA = IF(LineItems[Sku]="2163986-5",LineItems[Quantity]*5)
= IF(LineItems[Sku]="2148190-2",LineItems[Quantity]*1)
Is this because I have 2 expressions interering with one another, should they instead be built into the same line?
Thanks for your help so far 🙂
Tom
Ashish_Mathur
6 years agoSuper User
Hi,
Does this work?
=IF(LineItems[Sku]="2163986-5",LineItems[Quantity]*5,LineItems[Quantity])
Hope this helps.