Friday, February 14, 2014

SSAS Calculations tab : Unexpected error occurred: 'Length cannot be less than zero. Parameter name 'length'

Recently I came across one error under Calculations tab. I was not able to access my calculations tab and calculations tab was showing following error.

Unexpected error occurred: 'Length cannot be less than zero. Parameter name 'length'

Sometimes if you are modifying your MDX code under calculations tab and if you missed any syntax under any of the calculations then probably you may encounter the same issue. Now how to resolve this error because you are not even able to access calculations tab if want to correct the syntax, So the solution is simple, connect to analysis services under management studio, right click on SSAS database and open your cube database XMLA using "Script Database as" and then using "ALTER To" option.

Under XMLA, find <MdxScript> node and check the syntax of your calculations, correct that and execute the script. As you are doing changes to calculations tab, you don't need to process/deploy cube. After execution of XMLA, if you open your project using BIDS, you will  be able to access your Calculations tab.


  1. Hi Anirudh,

    This is Prasad from Stratekk LLC, I was trying to reach you regarding a job opportunity for you as BI Developer with MDX in Atlanta GA, Please send me an email at

  2. Or just right-click your cube in solution explorer, there view code. Fix, save, and you 're back up and running. Much quicker!