# Calculating Column % based on Row value

In Income Statements is common to calculate a % based on a "Net Sales value" in a row, as follows.

 Statement Level 2 Jan % Gross Sales \$113,894,029 117.9% Freight Revenue \$0 0.0% Sales Returns -\$427,957 0.2% Cash Discounts -\$2,587,687 1.1% Rebates & Other -\$14,254,654 5.9% NET SALES \$96,623,730 100.0% Standard Cost -\$161,325,163 66.6% Standard Margin \$39,929,722 33.4% PPV -\$5,552,000 2.3% Rev. & Inv / non Recurring -\$305,707 0.1% Freight Variance -\$395,473 0.2% Freight Expense -\$18,962,363 10.7% Allocation - Mfg Variance \$11,029,040 4.6% Allocation - Staff -\$4,119,284 1.7% Gross Profit \$23,623,935 23.0% Customer Support -\$3,283,805 1.4% Samples - Expense -\$351,480 0.1% Marketing -\$1,364,727 0.6% Selling & Service -\$13,282,339 5.5% Regional Warehouse \$328,742 0.1% Allocation RDC \$474,752 0.2% Allocatioin General Selling Exp \$0 0.0% Bad Debts \$0 0.0% Allocation SG&A -\$2,292,511 0.9% Total SG&A -\$19,771,367 8.2% Operating Income \$12,852,568 14.8%

Any suggestions to build this in beastmode?

I tried calculating in my dataflow an additional column with the "Net Sales Value" for every row, and it worked.

But when I start to apply filters to the card (e.g. by region), the calculations are incorrect because the "Net Sales Value" is valid only "without filters".  So I need to calculate this "Net Sales Value "on the fly" in a beastmode formula.

Any suggestions for this?

• 🔵

Such a good question and a big need to fulfill.

Domo's out of the box cards aren't very good at nested, heirarchical financial statements.  And row level value versus aggregated value comparison can be difficult as well.

Frankly, I've used Domo app store apps or custom apps for the best financial reporting in Domo.

In case that's not possible, you could experiment with window functions in your beast modes.  I don't think they're fully supported but can work with the right syntax.

Aaron
MajorDomo @ Merit Medical

**Say "Thanks" by clicking the heart in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"