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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
KarenQ
Helper I
Helper I

Inventory Forecast using carried forward actual SOH QTY which is a calculated measure.

Hi I have problem using the actual SOH total as the start point of month Nov onward for forecast purpose. 

My aim is to use DAX to have all futuer months (Nov onward) show as 71 Qty on hand which is carried forward from last month actual. 

 

KarenQ_2-1701064286511.png

 

If anyone would help find a solution please? below rawdata sample only. Actual database is very big accross months of past two years showing EOM stock level by item.

 

KarenQ_1-1701064144063.png

 

 

https://app.powerbi.com/links/e6Gdg-dA7e?ctid=b3041bfd-b8fd-48d7-8f9d-0d3c53a7e449&pbi_source=linkSh...

 

 

1 ACCEPTED SOLUTION

The answer should be 62 for all months from October onwards.  Revise the QoH measure to:

QoH = if(MAX('Calendar'[Date])>=EOMONTH(today(),-1)+1,CALCULATE([Q],CALCULATETABLE(LASTNONBLANK('Calendar'[Date],CALCULATE([Q])),DATESBETWEEN('Calendar'[Date],MINX(ALL('Calendar'),'Calendar'[Date]),EOMONTH(today(),-1)))),[Q])

Hope this helps.

Ashish_Mathur_0-1701216193335.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

13 REPLIES 13
Ahmedx
Super User
Super User

pls try

Screenshot_1.png

Thanks for your prompt reply. 

I tried and had issue with m2

 

m2 = CALCULATE(MAX('Table'[FullMonth]), FILTER(ALL('Table'),'Table'[Qtr on Hand]>0))

KarenQ_0-1701126797023.png

I alternatively used the below and does not work either. 

CurrFullMTH = DATE(YEAR(TODAY()),MONTH(TODAY()-29), 1)
 
Meanwhile, variation to my orignal post is Qty On Hand against full month 01/10/2023 for example, acutally refers to SOH lelvel for the month before, i.e. Sept. 

I can't access it, can you share the file?

Resending the below.

Not much difference to the orignal link.

 

in case you still could not open the link, below rawdata

Item           Qty on hand  FullMONTH  MonthNo

 
121/07/20231 
2581/07/20231 
321/07/20231 
131/08/20232 
2591/08/20232 
331/08/20232 
141/09/20233 
2601/09/20233 
341/09/20233 
151/10/20234 
2611/10/20234 
351/10/20234 
161/11/20234 
2621/11/20234 
361/11/20234 
101/12/20236dummy row
101/01/20247dummy row
101/02/20248dummy row
101/03/20249dummy row
101/04/202410dummy row
101/05/202411dummy row
101/06/202412dummy row

 

 

EOM Qty = CALCULATE(SUM(Table1[Qty on hand (incorrect)]), DATEADD(Table1[FullMONTH],1,MONTH))
 

https://app.powerbi.com/links/e6Gdg-dA7e?ctid=b3041bfd-b8fd-48d7-8f9d-0d3c53a7e449&pbi_source=linkSh...

Hi,

Why are there 0's in the Quantity column for months from Dec onwards?  Shouldn't those be blanks?


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

hi Ashish, please refer to this file. 

 

https://app.powerbi.com/links/e6Gdg-dA7e?ctid=b3041bfd-b8fd-48d7-8f9d-0d3c53a7e449&pbi_source=linkSh...

 

I mannaully created Dec onward lines and you could delete it if you do not need them.

Actual quantity aginast fullmonth 01/11/2023 should be the stock level for Oct end of month since these stock valuation reports are ran in the very early hours of the 1st of a new month. 

Hi,

Just to let you know the link that you have shared is not that of a downloadable file.

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1701155893704.png

 

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

hi Ashish, thanks for your reply. Seems I could not send a downloadable pbix file. 

 

Oct is supposed to be latest finalised month which has full month 01/11/2023 against it in the table so latest actual QoH shoud be 65 for Oct and then the same much for future forecast periods. (nb. I had to reference it this way to serve other purposes). 

Below my updated rawdata to replicate my real database.

 

Item Qty on hand WHS FullMONTH MonthNo

12A1/07/20231
11B1/07/20231
258A1/07/20231
32A1/07/20231
13A1/08/20232
259A1/08/20232
33A1/08/20232
40A1/08/20232
14A1/09/20233
20A1/09/20233
260B1/09/20233
30A1/09/20233
10A1/10/20234
261A1/10/20234
31A1/10/20234
11A1/11/20234
262A1/11/20234
32A1/11/20234

 

 

The answer should be 62 for all months from October onwards.  Revise the QoH measure to:

QoH = if(MAX('Calendar'[Date])>=EOMONTH(today(),-1)+1,CALCULATE([Q],CALCULATETABLE(LASTNONBLANK('Calendar'[Date],CALCULATE([Q])),DATESBETWEEN('Calendar'[Date],MINX(ALL('Calendar'),'Calendar'[Date]),EOMONTH(today(),-1)))),[Q])

Hope this helps.

Ashish_Mathur_0-1701216193335.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Appreciate your help!

You are welcome.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I can’t help without the file, I don’t know what’s in your matrix
Please note that I have the beginning of each month, and you should have it too

hi I have just recreated the file as per below for your help.

Oct is supposed to be latest finalised month which has full month 01/11/2023 against it. (nb. I had to reference it this way to serve other purposes. 

let me know if you could open this link.

as you see m2 and final are not shows as expected. 

 

https://app.powerbi.com/links/e6Gdg-dA7e?ctid=b3041bfd-b8fd-48d7-8f9d-0d3c53a7e449&pbi_source=linkSh...

 

Thanks in advance. 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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