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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
nagaraj007
Post Patron
Post Patron

Unable to get Opening and closing stock amount

Hi ,

 

I am unable to get the opening and closing stock amount. please advise.

 

Attached is the PBIX 

@v-deddai1-msft 

16 REPLIES 16
Anonymous
Not applicable

Hi @nagaraj007 ,

 

Sorry for my late reply.

 

The MAX('Calendar'[Date]) in your Opening Stock measure returns the 12/31/2020. It's the max date in your calendar table.

Could you please tell me what you want to filter with Sheet1[Date]< MAX ('Calendar'[Date] )?

17.png

 

CROSSFILTER specifies the cross-filtering direction to be used in a calculation for a relationship that exists between two columns. Do you want to cancel the relationship between the two tables?

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

 

Measure is working perfectly and showing correct results for opening stock QUANTITY. 

So i am looking for opening stock VALUE measure. Could you please help me 

Hi @Anonymous ,

 

Could you please help me

Could any one please help me?

Anonymous
Not applicable

Hi @nagaraj007 ,

 

What's the calculation logic of the Opening Stock Value?

Sorry, I didn't find the calculation logic of Opening Stock Value in your file.

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @Anonymous ,

 

The logic for opening stock is 

Opening Stock =
CALCULATE (
[Movement] ,
FILTER (
ALLEXCEPT ( Sheet1, Sheet1[Group],Sheet1[Item Details] ),
Sheet1[Date]< MAX ( 'Calendar'[Date] )
),CROSSFILTER(Sheet1[Date],'Calendar'[Date],None)
)
 
This is also available in the PBIX file which has a measure named opening stock
Anonymous
Not applicable

Hi @nagaraj007 ,

 

The Opening Stock measure was found. I want to ask about the logic of Opening Stock value which you framed it with a red box.

output.png

 

 

Best Regards,

Stephen Tao

Hi @Anonymous ,

 

Could you please help me to solve this issue

I have used the below logic, however the total amount as of now is not showing correctly. 

 

I do have Price per unit column also in the PBIX file, i tried to get the qty*price but its showing wrong numbers, so i decided to use amount directly which is near to the output. But the management wants to see the exact number

 

 

Opening Stock value = CALCULATE (
[Movement op value] ,
FILTER (all(Aging[Date] ),
Aging[Date] < min( 'Calendar'[Date] )
),CROSSFILTER(Aging[Date],'Calendar'[Date],None)
)

 

Movement op value = calculate(sum(Aging[Amount]), Aging[Type]="Purchased")-calculate(sum(Aging[Amount]), Aging[Type]="Issued")+0

 

 

Hi @Anonymous ,

 

Could you please help me

amitchandak
Super User
Super User

@nagaraj007 , Not sure I got it. But I think that is what it is showing. If needed you can add +0 to opening and closing stock

Can you share output in table format?

 

Screenshot 2020-11-20 12.08.58.png

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Please find the output. I want to show Opening stock qty and also opening stock amount. output.png

hi @amitchandak ,

 

I have attached the output required. Could you please help me

 

 

Hi,

could anyone help me?

amitchandak
Super User
Super User

@nagaraj007 , Please find the file attached after signature can help

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Hi @amitchandak ,

 

I am looking out for the total amount against opening stock as well as closing stock. amount.png

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.