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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Vinod_P
Helper I
Helper I

Opening stock - supply - demand - closing stock

Below is the sameple data and looking for demand( Count of values in demand date column) & Supply (Count of values in the supply date column) , Looking at a view to compare both counts like 1-1 against the fixed jan to dec month on X-axis.

 

ID NUMBERPart numberCUSTOMERDEMAND DATESUPPLY DATE
11Vinod 17/08/202212/01/2023
21Vinod 17/08/202204/05/2023
31Vinod 17/08/202227/01/2023
41Vinod 17/08/202205/04/2023
52Vinod 01/02/202220/01/2023
62Vinod 01/02/202220/01/2023
72Vinod 01/02/202220/01/2023
82Vinod 01/02/202220/01/2023
92Vinod 01/02/202210/03/2023
102Vinod 01/02/202228/02/2023
112Vinod 01/02/202210/03/2023
122Vinod 01/02/202205/04/2023
132Vinod 27/04/202220/01/2023
141Vinod 21/10/202205/04/2023
151Vinod 21/10/202205/04/2023
161Vinod 21/10/202217/04/2023
171Vinod 21/10/202204/05/2023
181Vinod 21/10/202217/04/2023

 

Expecting outcome as below. 

Opening stock = Previous month closing stock

Supply = count of supply date column

Demand = count of demand date column

Closing stock = Opening stock + Supply - Demadn

 

Vinod_P_0-1684764734017.png

Thanks in advance 

3 REPLIES 3
v-eqin-msft
Community Support
Community Support

Hi @Vinod_P ,

 

Here I have some questions about your calculation logic.

1.Opening stock = Previous month closing stock

There are two date columns in your data model, demand date and supply date, which one should be the date column I choose to get previous month data.

There isn't any status in your data model, how can I check whether the stock is closed.

How to get negative numbers in your calculation?

 

2.Supply = count of supply date column

The number I count the Supply Date on 2023/01 should be 7, how to get 3.

 

3.Demand = count of demand date column

The number I count the Demand Date on 2023/01 should be 0, how to get 9.

 

Best Regards,
Rico Zhou

 

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

 

Hi , 

Please find the explanation 

1. Better explain with an example if I want opening stock of Jan '23 = (Total supply- total demand + opening stock) of dec '22 technically in theory its the previous month left over stock after all transactions. 

Dec left over stock will carryforward as opening stock for next month. 

 

For 2 & 3 sorry since I put some random numbers to fill the blanks. 

 

Vinod_P_0-1684922901821.png

 

Formula screenshot FYR

Vinod_P_2-1684922963027.png

Please let me know if any other clarifications required

 

Or to still simplify remove opening stock and preious month closing stock should be added to current 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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