From what it seems that you have a combination of DOCID and ITEMID repeating 27 times in your dashboard.... that is why when you sum in the script you are getting 135 (5*27), 108 (4*27), 270 (10*27)... etc.... May be you need to add distinct? or use Only?
Only(Num (Trim([QTY]),'#,##0', '.' , ',')) as PRQTY
group by DOCID,ITEMID;
Sum(DISTINCT Num (Trim([QTY]),'#,##0', '.' , ',')) as PRQTY