## Something like a running total...

 Author Message marty.seed SSC Journeyman Group: General Forum Members Points: 95 Visits: 199 Hello!I am tracking our company's inventory in a SSRS 2008 Tablix report. I am displaying the inventory for each day, at the end of the Month I need to display the Month inventory...basically the inventory on the last day of the month. Select invDate, Branch, Month(invdate) as Month_,InvBalanceFrom DailyInventoryMatrix row group=Branchcolumn group=Month_, invDate Nick_UK UDP Broadcaster Group: General Forum Members Points: 1465 Visits: 1179 Could you do a sum on the values where the invdate equals the max invdate within the month grouping, something along the lines of,SUM(IIF(invdate = MAX(invdate,"Month"),InvBalance,0) marty.seed SSC Journeyman Group: General Forum Members Points: 95 Visits: 199 That's not working, I am trying to do this in a Matrix so it is not recognizing that "cell" as having any data marty.seed SSC Journeyman Group: General Forum Members Points: 95 Visits: 199 We are definitely on the right track here, I need to find the value for the max(date) and pass it to the "Total" cell...now how to do this??? marty.seed SSC Journeyman Group: General Forum Members Points: 95 Visits: 199 I figured out how to do it for the weekly total rows...=iif(InScope("Date2"), sum(Fields!Sales.Value), last(Fields!Sales.Value))Now the conundrum lies in trying to total the total columns correctly Jeff Moden SSC-Forever Group: General Forum Members Points: 44998 Visits: 39880 marty.seed (11/10/2009)I figured out how to do it for the weekly total rows...=iif(InScope("Date2"), sum(Fields!Sales.Value), last(Fields!Sales.Value))Now the conundrum lies in trying to total the total columns correctlyHi Marty,Did you ever get this sorted out? --Jeff ModenRBAR is pronounced ree-bar and is a Modenism for Row-By-Agonizing-Row.First step towards the paradigm shift of writing Set Based code: Stop thinking about what you want to do to a row... think, instead, of what you want to do to a column.Although they tell us that they want it real bad, our primary goal is to ensure that we dont actually give it to them that way.Although change is inevitable, change for the better is not.Just because you can do something in PowerShell, doesnt mean you should. Helpful Links:How to post code problemsHow to post performance problemsForum FAQs