I actually found the problem but could not find the code to it.
I have reporting month which starts every 28th of the month and end 27th of next month. but when i try to get the running balance which is MTD() for it , it still takes the calander month in consideration. and when i specify the report hirerarchy , i get a #value error message throught.
the current code which i was using was
for report , i was trying to provide a hirerarchy was