Forum Discussion
Incorrect Measure Totals
- 5 years ago
Try the following formula
Available Inventory = SUMX(VALUES ( 'items'[Item_Number] ), CALCULATE ( SUM ('items'[Inventory])))
-
SUMX(VALUES ( 'items'[Item_Number] ), CALCULATE ( SUM ('Sales_Lines'[Quantity on SO])))
Change 'items'[Item_Number] to No .. name of first field.
If you could share the file that would be even better. Mask any sensitive data
Yeah, I replaced the 'items'[Item_Number] to No. Sorry I'm very new at this I don't know how to mask.
- olivere915 years agoHelper I
I fixed it! the measure now reads:
Available Inventory = SUMX(VALUES ( 'items'[No] ), CALCULATE ( SUM ('items'[Inventory])))-SUMX(VALUES ( 'items'[No] ), CALCULATE ( SUM ('Sales_Lines'[On Open SO])))Can you explain why my original measure wasn't working every time?- themistoklis5 years agoCommunity Champion
Hello olivere91 ,
An article that explains the issue, is the following:
https://blog.enterprisedna.co/why-your-total-is-incorrect-key-power-bi-concept/
It has to do with how PowerBi read the context especially if you have filters applied.
SUMX is an iterator and it reads data row by row
Values function makes sure that every row displayed in the table will be read