When refreshing a pivot table or changing a filter or slicer in Excel 2013/2016 the user received the error: Current session is no longer valid due to structural changes in the database.
This appears to happen when a combination of things are used.
- The worksheet contains custom MDX calculations that are native to Excel (ie: they don't exist in the cubes themselves)
- A timeline slicer is used (although this may not always be the case)
- The cube has been refreshed while the Excel workbook is still open
It appears that the Excel workbook cannot maintain a proper connection to the cubes when custom MDX calculations are added and the cube is refreshed.
Adding the custom MDX calculations to the cube as Calculated Measures will resolve the issue.