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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
There are X number of items(For eg: A,B,C) being managed in the records of the inventory. For any given date the record in the database is only available for those items that were affected due to sale or purchase transaction.
The goal is to produce this report for any given date which is the total value of inventory irrespective of any transaction on that day.
In order to arrive at this it will be necessary to compute value of each item irrespective of the transaction on that date:
I need help with the dax query to achieve the above goal.
Thanks.
// If you store everything in
// one table T...
// this will give you the value
// on the last visible day
// in the current context.
[Total Value] =
var __lastVisibleDay =
MAX( T[Date] )
var __result =
SUMX(
VALUES( T[Item] ),
MAXX(
TOPN(1,
CALCULATETABLE(
T,
T[Date] <= __lastVisibleDay,
ALL( T[Date] )
),
T[Date],
DESC
),
T[Value]
)
)
return
__result
The solution gives the sum of the values for the items whose transactions have taken place on a particular day. It does not include the items that did not have any transactions on that day. The goal is to compute the total value of the inventory covering all items irrespective of whether they were transacted on the given day. Please refer the example from the images.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 9 | |
| 7 | |
| 6 | |
| 6 | |
| 5 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 18 | |
| 14 | |
| 14 |