Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I'm trying to figure out a way to calculate the starting and ending inventory. Data of inventory is transactions (Item Ledger Entries from Business Central) as shown below.
I wan't to be able to slice the dates for a given period.
Then by the values of the slicer i need to calculate the sum of quantity until the first date of the slicer (SOP).
Further i need to calculate the sum of quantity until the last date of the slicer (EOP).
I've tried to visualize my request:
Thanks in advance!
Solved! Go to Solution.
If you have a Date table linked to your fact table you could use
SOP =
VAR MinDate =
MIN ( 'Date'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Qty] ),
REMOVEFILTERS ( 'Date' ),
'Date'[Date] < MinDate
)
EOP =
VAR MaxDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Qty] ),
REMOVEFILTERS ( 'Date' ),
'Date'[Date] < MaxDate
)
Hi @johnt75,
Thanks for the recommendation! It works perfectly for now! Hopefully I'll be able to figure it out myself as the measure expands.
Thanks again!
If you have a Date table linked to your fact table you could use
SOP =
VAR MinDate =
MIN ( 'Date'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Qty] ),
REMOVEFILTERS ( 'Date' ),
'Date'[Date] < MinDate
)
EOP =
VAR MaxDate =
MAX ( 'Date'[Date] )
RETURN
CALCULATE (
SUM ( 'Table'[Qty] ),
REMOVEFILTERS ( 'Date' ),
'Date'[Date] < MaxDate
)
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 |
|---|---|
| 6 | |
| 5 | |
| 4 | |
| 4 | |
| 4 |
| User | Count |
|---|---|
| 24 | |
| 21 | |
| 12 | |
| 10 | |
| 8 |