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
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
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.