Forum Discussion
SUMMARIZE Not Returning Correct Sum Value
- Anonymous6 years ago
Using the "Group By" functionality in Power Query Editor worked for me. I followed the instructions near the bottom of this article link...Link
Hi. I'm going to try and take a stab at it. What if you had the measure as something like...
Production Qty = CALCULATE(SUM('Table'[Production Quantity]), ALLEXCEPT('Table', 'Table'[Scheduled Shift]))
... where the values for 'Table' are whatever table you're sourcing from.
The first 'Table' is the table that [Production Quantity] comes from, second 'Table' is that same table. The third 'Table' is the table from which [Scheduled Shift] is sourced from.
As for the weighted average (this is more of a proportion or weighted average coefficient, but a nomenclature debate is out of scope), you just do,
Weight Av = DIVIDE([Production Quantity],[Production Qty])
...but based on your values of 1.000, it looks like you may already be doing something similar.
Hope this helps.
- Anonymous6 years agoNot applicable
Anonymous
That's what I had originally but the records inflate as the ALLEXCEPT() function ignores any relationships configured in the data model and creates a foreach combination result.
- Anonymous6 years agoNot applicable
That makes sense.
Can you post the formula you entered using SUMMARIZE to derive the 'Production Qty' measure?
- Anonymous6 years agoNot applicable
Here's the DAX behind the measure...
Production Qty (Date-PlantNum-PlantType-ProdLine-Shift) =SUMX(SUMMARIZE('HANA Production Fact','HANA Production Fact'[Scheduled Date], 'HANA Production Fact'[Plant], 'HANA Production Fact'[COS Production Line], 'HANA Production Fact'[Scheduled Shift],"Production Qty 1",CALCULATE(SUM('HANA Production Fact'[Production Quantity]))),[Production Qty 1])