# Custom Mode Calculation Error - Is there a limit on the number measures that can be used in a calculation?

**URL:** <https://pug.phocassoftware.com/t/custom-mode-calculation-error-is-there-a-limit-on-the-number-measures-that-can-be-used-in-a-calculation/1778>\
**Category:** Ask the Community\
**Created:** [January 8, 2021, 2:24pm UTC](https://pug.phocassoftware.com/t/custom-mode-calculation-error-is-there-a-limit-on-the-number-measures-that-can-be-used-in-a-calculation/1778 "2021-01-08T14:24:15Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Justin](https://avatars.discourse-cdn.com/v4/letter/j/3ab097/32.png) [@Justin](https://pug.phocassoftware.com/u/Justin)\
**Post date:** [January 8, 2021, 2:24pm UTC](https://pug.phocassoftware.com/t/custom-mode-calculation-error-is-there-a-limit-on-the-number-measures-that-can-be-used-in-a-calculation/1778/1 "2021-01-08T14:24:15Z")

</div>

I am working in Custom Mode and building a calculation, but after applying my calculation, I keep getting “An error has occurred when querying the data”

I noticed not all of my measures have a variable assigned to them. It looks like whenever I add more than 5 measures, the additional measures do not get a variable assigned and the box is blank.

Does anyone know if there a limit to the number of measures that can be used when writing the expression for a calculation?

Here is what I am trying to do, but it is not working. Notice the measures after “e”, do not get a variable assigned.

 ![image](https://us1.discourse-cdn.com/flex015/uploads/phocassoftware/original/2X/a/a38df06b16ad64b8d3971249f2532196c4cecfe6.png)

---

<div class="post-metadata">

**Author:** ![JonKemp](https://sea1.discourse-cdn.com/flex015/user_avatar/pug.phocassoftware.com/jonkemp/32/334_2.png) [@JonKemp](https://pug.phocassoftware.com/u/JonKemp)\
**Post date:** [January 8, 2021, 3:29pm UTC](https://pug.phocassoftware.com/t/custom-mode-calculation-error-is-there-a-limit-on-the-number-measures-that-can-be-used-in-a-calculation/1778/2 "2021-01-08T15:29:56Z")

</div>

My understanding is its a max of 5 hence why measures after “e” are not assigned a letter.

---

<div class="post-metadata">

**Author:** ![wpratt](https://avatars.discourse-cdn.com/v4/letter/w/2acd7d/32.png) [@wpratt](https://pug.phocassoftware.com/u/wpratt)\
**Post date:** [March 4, 2021, 4:48pm UTC](https://pug.phocassoftware.com/t/custom-mode-calculation-error-is-there-a-limit-on-the-number-measures-that-can-be-used-in-a-calculation/1778/3 "2021-03-04T16:48:30Z")

</div>

I ran into the same issue after my 5th measure. Definitely an area Phocas needs to be a bit more robust.
