This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreLevel up your Power BI skills this month - build one visual each week and tell better stories with data! Get started
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])Solved! Go to Solution.
Hi @Anonymous ,
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])))Pbix attached: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EQ__7Plc54lMtqm3_xzXLZ4BA-WddcSgisEuZGpDFPXuuQ?e=YxVoHG
Hi @Anonymous ,
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])))Pbix attached: https://wicren-my.sharepoint.com/:u:/g/personal/dinaye_wicren_onmicrosoft_com/EQ__7Plc54lMtqm3_xzXLZ4BA-WddcSgisEuZGpDFPXuuQ?e=YxVoHG
Hi @Anonymous ,
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
Check out the April 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 35 | |
| 32 | |
| 26 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 37 | |
| 32 | |
| 25 | |
| 23 |