Power Pivot - Inner Join like access, calculate and show grand total, possible?

132 Views Asked by At

I'm trying to acive the following with power pivot. Still couldn't figure out how. Is it possible?

Example from access

Gourped by “MatNr”. “Qty cases” are summed. From the “tbl_Weight” show the “Cases on trolley” per material. Divide “summed Qty cases” by “Cases on trolley” and show the results in the fourth column. Most importantly total the “summed Qty cases” column and the “Nr of trolleys per mat” column.

Two tables: tbl_Sales MatNr Qty cases 4564 100 4654 565 4564 100 4654 50

tbl_Weight MatNr Cases on trolley 4564 10 4654 20

Query:

SELECT tbl_Sales.MatNr, Sum(tbl_Sales.[Qty cases]) AS [SummevonQty cases], tbl_Weight.[Cases on trolley], Sum([Qty cases]/[Cases on trolley]) AS [Nr of trolleys per mat] FROM tbl_Sales INNER JOIN tbl_Weight ON tbl_Sales.MatNr = tbl_Weight.MatNr GROUP BY tbl_Sales.MatNr, tbl_Weight.[Cases on trolley];

Expected results:

MatNr SummevonQty cases Cases on trolley Nr of trolleys per mat 4564 200 10 20 4654 615 20 30.75 Totals 815 50.75

0

There are 0 best solutions below