Forum Discussion

t_young's avatar
t_young
Regular Visitor
1 year ago
Solved

Measure Total Incorrect

I know there are a bunch of threads about this matter, but none of the solutions that I've found seem to work for my particular measure. Below is the data that I am working with:

 

Amount is the measure that I have created in my report. I am able to get the line level calculations correct, but my total is showing as $22.02, instead of the $18.53.

 

The measure that I am using for amount is as follows:

Amount = 

VAR ShippedQty = AVERAGEX(Table,Table[Qty])
VAR UnitCost = AVERAGEX(Table,Table[Unit Cost])
VAR QtyPer = SUMX(Table,Table[QtyPer])
RETURN
((UnitCost*QtyPer)*.25)*ShippedQty
  • t_young 

    This should work for you:

    Amount = 
    SUMX(
       SUMMARIZE( Table, Table[Parent Part] , Table[Sub Part] , Table[Order #] ),
        VAR ShippedQty = CALCULATE( AVERAGE(Table[Qty]) )
        VAR UnitCost = CALCULATE( AVERAGE(Table[Unit Cost]) )
        VAR QtyPer = CALCULATE( SUM(Table[QtyPer]) )
        RETURN
        (
            ( UnitCost * QtyPer ) * .25
        ) * ShippedQty
    )

3 Replies