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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
MrHelpless
Frequent Visitor

Refering to value from week before and predicting future values

Hello all,

 

I've been struggleing with a kind of recursive problem in my report and still haven't figured out how to solve it. I've already referred to this post from the forum  which I guess is pretty similar and other posts but I still can't make it fly on my end. Hope you guys can help me out!

My issue is: I have a dataset with different warehouses and products and their respective Inventories for each week (always as of Friday) as well as the Sales targets for those weeks and the weeks in the future.

 

I now want to calculate a coulmn which states the Inventories when data is available and predicts the Inventory for dates in the future based on the sales target. At the same time, the context of warehouses and products has to stay intact.

 

For example, I'd like to calculate the Inventory on 01/18/19 based on the Sales Target. It should perform the following calculation: 

Predicted Inventory for 01/18/19 = Inventory from week before (01/11/2019) - Sales target (=8) = 102

 

Of course it should take this calculated value to further predict 01/25/2019

 

issue.png

 

Thanks for your help!

2 REPLIES 2
v-chuncz-msft
Community Support
Community Support

@MrHelpless ,

 

You may take a look at the post below.

https://community.powerbi.com/t5/Desktop/cumulative-portfolio-returns/m-p/275884#M123036

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-chuncz-msft 

 

thanks for your reply. But I still can't figure out how to apply the filter correctly.

That's what I have so far:

 

INV Proj = 
IF( [INV SUM]<>BLANK(), [INV SUM],

SUMX (
     FILTER( TABLE; [Week] <= EARLIER(TABLE[Week] ) ,
    [Inventory]-[Sales Target] )

The thing is now that I have several warehouses and products and I can't figure out on how to add the additional filters. Adding them with the && it'll always break my EARLIER function

 

Any further tipps?


Cheers!

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

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

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