Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Detailed data when put into a table is not giving right sum.

Hi,

 

I have detail data with colums orderno, line, qty_line, qty_order. Sample data below.

when I try to summarize it by orderno and take out line. it gives me incorrect sum for qty_order. It gives me 64 but should only be 8.

 

order no    qty_line   qty_order  (output)                       order no    qty_line   qty_order     ( output needed)     

 201            8               64                                               201            8               8

 

I tried creating measures using max, maxx, summarize and calcuate but nothing is helping. Any insight will be highly appreciated.

  • Anonymous add new measure

     

    Total Qty Order = 
    SUMX ( VALUES ( YourTable[OrderNumber] ), CALCULATE ( MAX ( YourTable[Qty_Order] ) ) )

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡

4 Replies

  • Anonymous add new measure

     

    Total Qty Order = 
    SUMX ( VALUES ( YourTable[OrderNumber] ), CALCULATE ( MAX ( YourTable[Qty_Order] ) ) )

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thank you so much, that works.

       

  • Anonymous change the aggregation from SUM to MAX you can change it where you have dropped qty_order column in the table visual, click on arrow next to the column in the visual and change the aggregation.

     

    Check my latest blog post Comparing Selected Client With Other Top N Clients | PeryTUS  I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡

  • Anonymous's avatar
    Anonymous
    Not applicable

    MAX doesnot work for the below.

    If I want to do by London it gives me sum 70 but should be 78.