Forum Discussion

olivere91's avatar
olivere91
Icon for Helper I rankHelper I
5 years ago
Solved

Incorrect Measure Totals

Hi, I'm having trouble with a measure giving inconsistent results:

 

Available Inventory =
SUM('items'[Inventory]) - SUM('Sales_Lines'[Quantity on SO])
 
Below is an exmaple, the top line is correct the bottom line is not. What can I do?
 
  • Try the following formula

    Available Inventory = SUMX(VALUES ( 'items'[Item_Number] ), CALCULATE ( SUM ('items'[Inventory])))
    -
    SUMX(VALUES ( 'items'[Item_Number] ), CALCULATE ( SUM ('Sales_Lines'[Quantity on SO])))

     

8 Replies

  • themistoklis's avatar
    themistoklis
    Icon for Community Champion rankCommunity Champion

    Hello olivere91 ,

     

    Are there any other fields in the table which are not displayed in the image that you sent?

    • olivere91's avatar
      olivere91
      Icon for Helper I rankHelper I

      Hi there, plenty of rows following the same formula. The only other colums not shown here are Item number and Item description. There is also a filter for item type category. 

      • themistoklis's avatar
        themistoklis
        Icon for Community Champion rankCommunity Champion

        Try the following formula

        Available Inventory = SUMX(VALUES ( 'items'[Item_Number] ), CALCULATE ( SUM ('items'[Inventory])))
        -
        SUMX(VALUES ( 'items'[Item_Number] ), CALCULATE ( SUM ('Sales_Lines'[Quantity on SO])))