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.
v-frfei-msft
6 years agoCommunity Support
Hi Anonymous,
I have created a sample for your reference, please use the measures as below to work on it.
Measure =
VAR sku =
MAX ( 'Table'[SKU] )
VAR leng =
SEARCH ( "-", sku, 1, BLANK () )
VAR lenall =
LEN ( sku )
VAR num =
RIGHT ( sku, lenall - leng )
VAR qu =
SUM ( 'Table'[Quantity] )
var a = IF ( leng <> BLANK (), num * qu, qu )
RETURN
aMeasure 2 = SUMX('Table',[Measure])
For more details, please check the pbix as attached.