Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Anonymous
Not applicable

Start and end of period inventory by slicer values

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.

CRN_0-1667896466308.png

I wan't to be able to slice the dates for a given period.

CRN_1-1667896771818.png

 

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:

CRN_2-1667896821108.png

 

Thanks in advance!

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

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
    )

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

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!

johnt75
Super User
Super User

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
    )

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.