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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
vijayit43
Frequent Visitor

Opening Stock as per given input date by user

Dear All ,

             We want to create Opening Stock as per given Input date by User. how to achieve it. please suggest. for example.

ITEMNAMEDATEPHYSICALQTY
GV500-150216130-06-2016 27
GV500-150216102-07-2016 -15
GV500-150216106-07-2016 1
GV500-150216124-07-2016 1
GV500-150216125-07-2016 1
GV500-150216110-08-2016 1
GV500-150216111-08-2016 4
GV500-150216117-08-2016 1
GV500-150216128-08-2016 -13
GV500-150216115-09-2016 -4
GV500-150216122-12-2016 -1
GV500-150216106-04-2017 -3

 

if we Select date (07-07-2016) then Opening stock show as 13 how to achieve it please help.

 

1 ACCEPTED SOLUTION
Vvelarde
Community Champion
Community Champion

@vijayit43

 

Hi, try with this:

 

Assuming that you have a calendar table to your selection date. (Don't related to your table)

 

OpeningStock =
CALCULATE (
    SUM ( Table2[QTY] ),
    FILTER ( Table2, Table2[DATEPHYSICAL] < SELECTEDVALUE ( CalendarTable[Date] ) )
)

Regards

 

Victor

Lima Peru




Lima - Peru

View solution in original post

1 REPLY 1
Vvelarde
Community Champion
Community Champion

@vijayit43

 

Hi, try with this:

 

Assuming that you have a calendar table to your selection date. (Don't related to your table)

 

OpeningStock =
CALCULATE (
    SUM ( Table2[QTY] ),
    FILTER ( Table2, Table2[DATEPHYSICAL] < SELECTEDVALUE ( CalendarTable[Date] ) )
)

Regards

 

Victor

Lima Peru




Lima - Peru

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.

Top Solution Authors
Top Kudoed Authors