# What is the Best way to calculate percentage

**URL:** <https://pug.phocassoftware.com/t/what-is-the-best-way-to-calculate-percentage/1851>\
**Category:** Ask the Community\
**Tags:** howto, erp\
**Created:** [April 26, 2021, 3:19pm UTC](https://pug.phocassoftware.com/t/what-is-the-best-way-to-calculate-percentage/1851 "2021-04-26T15:19:37Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Crogers](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@Crogers](https://pug.phocassoftware.com/u/Crogers)\
**Post date:** [April 26, 2021, 3:19pm UTC](https://pug.phocassoftware.com/t/what-is-the-best-way-to-calculate-percentage/1851/1 "2021-04-26T15:19:37Z")

</div>

Im trying to calculate the percentage of True values by sync date so for this day there are 800 records and i need to know the percentage of True values of the Shortage field.  
whats the best way to do this?

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

---

<div class="post-metadata">

**Author:** ![dvic](https://sea1.discourse-cdn.com/flex015/user_avatar/pug.phocassoftware.com/dvic/32/1045_2.png) [@dvic](https://pug.phocassoftware.com/u/dvic)\
**Post date:** [April 27, 2021, 11:48am UTC](https://pug.phocassoftware.com/t/what-is-the-best-way-to-calculate-percentage/1851/2 "2021-04-27T11:48:53Z")

</div>

One possible way to accomplish this could be to:

1. Add a transform if-then column to designate True = 1 and False = 0 as [short\_count]
2. Add another transform column with simply ‘1’ as [line\_count]
3. Add both columns to the Measures.
4. Create a Custom Measure to divide the two values and multiply by 100:  
([short\_count / [line\_count]) \* 100
5. Change the new measure’s format to a percentage.

---

<div class="post-metadata">

**Author:** ![Crogers](https://avatars.discourse-cdn.com/v4/letter/c/f08c70/32.png) [@Crogers](https://pug.phocassoftware.com/u/Crogers)\
**Post date:** [April 27, 2021, 12:41pm UTC](https://pug.phocassoftware.com/t/what-is-the-best-way-to-calculate-percentage/1851/3 "2021-04-27T12:41:46Z")

</div>

Thank you, that worked.
