Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi, I'm having trouble with a measure giving inconsistent results:
Solved! Go to Solution.
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])))
Hello @olivere91 ,
Are there any other fields in the table which are not displayed in the image that you sent?
Hi there, plenty of rows following the same formula. The only other colums not shown here are Item number and Item description. There is also a filter for item type category.
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])))
That didn't work. These are the column headers if that helps.
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.
I fixed it! the measure now reads:
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