cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
cpe11 Frequent Visitor
Frequent Visitor

Rolling Subtraction from Fixed Inventory Value

I'm attempting to get the remaining inventory function to return the total inventory from the previous month minus the forecasted sales from the previous month. October and November are correct, however December should be 168 (175 - 7). The measure I'm currently using is as follows - pMonth Sales is just a quick measure to return the previous month's sales:

Remaining Inventory = 
if([Total Inventory] > 0 , [Total Inventory], 
CALCULATE(
    if([Total Inventory] > 0 , [Total Inventory], 
   CALCULATE([Total Inventory]
   ,PARALLELPERIOD(FiscalDateTable[Date],-1,MONTH)) - [pMonth Sales])
   ,PARALLELPERIOD(FiscalDateTable[Date],-1,MONTH)) - [pMonth Sales])

inventory ex.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Rolling Subtraction from Fixed Inventory Value

Hi @cpe11 ,

 

You can add the index column using query editor firstly, and then add the measures below:

Measure = IF(MAX('Table'[Index])=0,0,CALCULATE(MAX('Table'[Forecasted sales]),FILTER(ALL('Table'),[Index]=MAX('Table'[Index])-1)))
Measure 2 = 178-CALCULATE(SUMX('Table',[Measure]),FILTER(ALL('Table'),[Month]<=MAX('Table'[Month])))

005.PNG

Pbix attached: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EQ__7Plc54lMtqm3_xzXLZ...

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

View solution in original post

2 REPLIES 2
Community Support Team
Community Support Team

Re: Rolling Subtraction from Fixed Inventory Value

Hi @cpe11 ,

 

You can add the index column using query editor firstly, and then add the measures below:

Measure = IF(MAX('Table'[Index])=0,0,CALCULATE(MAX('Table'[Forecasted sales]),FILTER(ALL('Table'),[Index]=MAX('Table'[Index])-1)))
Measure 2 = 178-CALCULATE(SUMX('Table',[Measure]),FILTER(ALL('Table'),[Month]<=MAX('Table'[Month])))

005.PNG

Pbix attached: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EQ__7Plc54lMtqm3_xzXLZ...

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

View solution in original post

Community Support Team
Community Support Team

Re: Rolling Subtraction from Fixed Inventory Value

Hi @cpe11 ,

 

If my above post helps, could you please consider Accept it as the solution to help the other members find it more quickly. thanks!

Best regards,
Dina Ye

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

Helpful resources

Announcements
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

Super User Challenge: Can You Solve These?

Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Top Solution Authors