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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.