Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowJuly 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more
Hello.
I have a simple table as follows to calculate how many to fill inventory.
If Apple has a total of 10 inventory and there is a total order of 18, then I need to fill the inventory by 8.
How do you apply make a correct measure to correctly subtract ordered from inventory?
This SHOULD be the correct result
But I am getting this
Maybe because of the context of my subtraction measure (7-5)
Solved! Go to Solution.
I don't know what do you want to achive, but...
if you want to create a new dax table with stock values then:
Inventory =
Inventory measure =
SUMX(
SUMMARIZE(
SampleData,
SampleData[Inventory]
),
SampleData[Inventory]
)
Ordered measure = SUM(Inventory[Ordered])
Inventory to fill = [Ordered measure] - [Inventory measure]
Result:
Proud to be a Super User!
I don't know what do you want to achive, but...
if you want to create a new dax table with stock values then:
Inventory =
Inventory measure =
SUMX(
SUMMARIZE(
SampleData,
SampleData[Inventory]
),
SampleData[Inventory]
)
Ordered measure = SUM(Inventory[Ordered])
Inventory to fill = [Ordered measure] - [Inventory measure]
Result:
Proud to be a Super User!
you need to replace the words ordered with something else or write _ordered
Hello @Ahmedx,
Thank you for your quick reply. I tried your solution but some records don't work (inventory-ordered). Maybe I am missing something else? Thanks again.
Inventory to fill =
var inventory = CALCULATE(SUM([Inventory]), REMOVEFILTERS([Order#]))
var ordered = CALCULATE(SUM([Ordered]), REMOVEFILTERS([Order#]))
return inventory - ordered
Hi @vicky_ ,
Thank you very much for your quick reply. Maybe there is a minor syntax that is missing. I get this error:
Thanks again.
Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.
Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.
| User | Count |
|---|---|
| 23 | |
| 22 | |
| 18 | |
| 17 | |
| 13 |
| User | Count |
|---|---|
| 63 | |
| 44 | |
| 42 | |
| 40 | |
| 39 |