Forum Discussion

Justas4478's avatar
Justas4478
Post Prodigy
3 years ago
Solved

Table totals showing wrong values

Hi I have a measure multiplies one column with other to do the multiplication. The result values are correct but when I look at the totals at the bottom of the table they are showing much bigger numbers. When I filter for singe item totals match to that item but whent there are more than 1 item in the table totals starting to show bigger than values for those items.

This is the DAX measure that I am using. 

PICKS_VALUE £ =
CALCULATE(SUMX(DIM_ITEM,'DIM_ITEM'[UNIT_PURCHASE_COST]) * SUMX(VAL_WHSE_ONHAND_6AM,'VAL_WHSE_ONHAND_6AM'[ONHAND]))
 

 

The totals expected for the PICKS_VALUE £ should be 128064 and for PICKS_VOLUME 666.05
Thanks.
  • Mikelytics's avatar
    Mikelytics
    3 years ago

    HI Justas4478 

     

    sorry, I identified another missing piece (i think". Please try:

    PICKS_VALUE £ =
    
    SUMX(
       DIM_ITEM,
       'DIM_ITEM'[UNIT_PURCHASE_COST] * CALCULATE(SUM('VAL_WHSE_ONHAND_6AM'[ONHAND]))
    )

    Best regards

    Michael

    -----------------------------------------------------

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    Appreciate your thumbs up!

    @ me in replies or I'll lose your thread.

    -----------------------------------------------------

    LinkedIn

8 Replies

  • Mikelytics's avatar
    Mikelytics
    Resident Rockstar

    Hi Justas4478 

     

    Can you please try the following:

     

    PICKS_VALUE £ =
    
    SUMX(
       DIM_ITEM,
       'DIM_ITEM'[UNIT_PURCHASE_COST] * 'VAL_WHSE_ONHAND_6AM'[ONHAND]
    )

     

    If this does not work then I would need to see your data model, especially how the two tables relate to each other and which columns from which table are used in the visual.

     

    Best regards

    Michael

    -----------------------------------------------------

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    Appreciate your thumbs up!

    @ me in replies or I'll lose your thread.

    -----------------------------------------------------

    LinkedIn

    • Justas4478's avatar
      Justas4478
      Post Prodigy

      Mikelytics I got this message when I tried your formula. 

      This is the realationships of the tables. They are connected using ITEM ID.

      Let me know if you need more information.

  • Mikelytics's avatar
    Mikelytics
    Resident Rockstar

    Hi Justas4478 

     

    right ... can you please try:

    PICKS_VALUE £ =
    
    SUMX(
       DIM_ITEM,
       'DIM_ITEM'[UNIT_PURCHASE_COST] * SUM('VAL_WHSE_ONHAND_6AM'[ONHAND])
    )

     

    Best regards

    Michael

    -----------------------------------------------------

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

    Appreciate your thumbs up!

    @ me in replies or I'll lose your thread.

    -----------------------------------------------------

    LinkedIn

    • Justas4478's avatar
      Justas4478
      Post Prodigy

      Mikelytics No error this time but totals still wrong. I guess the totals are looking at more items than just the ones on the table maybe.

      • Mikelytics's avatar
        Mikelytics
        Resident Rockstar

        HI Justas4478 

         

        sorry, I identified another missing piece (i think". Please try:

        PICKS_VALUE £ =
        
        SUMX(
           DIM_ITEM,
           'DIM_ITEM'[UNIT_PURCHASE_COST] * CALCULATE(SUM('VAL_WHSE_ONHAND_6AM'[ONHAND]))
        )

        Best regards

        Michael

        -----------------------------------------------------

        If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

        Appreciate your thumbs up!

        @ me in replies or I'll lose your thread.

        -----------------------------------------------------

        LinkedIn