Forum Discussion

Nimish's avatar
Nimish
Regular Visitor
3 years ago

Measure Column Total All Wrong

Hello

 

I got the measure total value wrong for one of a column in my Matrix Visual ( Column Name: CALC PRICE), which should be 0.22. Below is the matrix table and measure used to calculate that column

 

CALC PRICE = SUMPRICE * CALC

 

SUMPRICE = SUM ('TABLE'[PRICE])

CALC = DIVIDE ([SUMQTY , SUMQTYALL, BLANK())

SUMQTY = SUM('TABLE'[QTY]) & SUMQTYALL = CALCULATE(SUM('TABLE'[QTY],ALLSELECTED('TABLE'))

 

CAN ANYONE HELP IN HERE TO GET THE CORRECT COLUMN TOTAL!!

YearMonth NumberSite SKU QTYPRICECALC QTYCALCULATION (CALC QTY)CALC PRICECALCULATION (CALC PRICE)
20201A1234178500.130.23517817850/759000.03057310.235178*0.13
202011A1234178500.130.23517817850/759000.03057310.235178*0.13
20203A1234178500.130.23517817850/759000.03057310.235178*0.13
20206A123437000.320.0487483700/759000.01559950.048748*0.32
20207A1234186500.440.24571818650/759000.10811590.245718*0.44
TOTAL   759001.15  1.15 

 

Sample Data:

YearMonth NumberSite SKU QTYPRICE
20201A1234178500.13
202011A1234178500.13
20203A1234178500.13
20206A123437000.32
20207A1234186500.44

 

Thanks,

Nimish

1 Reply

  • Nimish , you should create a measure like

     

    sumx('TABLE' ,[QTY]*[PRICE])

     

     

    Multiplication done ate row level