Forum Discussion
divide between two tables
- 4 years ago
In that case you need the following measure:
Pallett number = SUMX ( 'Product Table', DIVIDE ( [Despatch Quantity], [Pallet Quantity] ) )
Hello PaulDBrown ,
Thank you for your reply.
I can confirm that this measure provides the correct result.
Can I ask for more feedback related to logic behind the correct measure (why this generates the correct result whereas the previous one not)?
Thank you
George
Well, DIVIDE does at it says. So the division is within the filter context and over the totals.
SUMX, on the other hand, performs the calculation (in this case the DIVIDE) within the filter context (so row by row) and then sums the result of each calculation to deliver the total. Make sense?
- Anonymous4 years agoNot applicable
- Anonymous4 years agoNot applicable
Hello PaulDBrown ,
In case I had a dates table and some other dimension tables, linked to the fact table (despatch table), how should this measure be edited? I am asking because your measure is based on the pallet table (or product table).
Thank you
George
- PaulDBrown4 years agoCommunity Champion
The table in SUMX should be whatever table is used in the visual to create the filter context of the visual. If more than one table is used in the visual, you will probably need to create an expression along the lines of:
SUMX(SUMMARIZE (FactTable, Dim Table 1 [Column1], Dim Table 2 [Column 2]), ....