Market Share (% of Total) and % Change/Trend Calculations
Is there a way using beast mode, or some other functionality, to create the following two equations in a DOMO card — to display on graphs as well as in a table/pivot table.
1) Market Share as a percent of total. In other platforms like PowerBI with DAX this would be achieved with something like the following random example: Sum(Sales)/Calculate(Sum(Sales),All(Colors). The idea being on a row where the color is red, it would divide the sales figures for red by the total sales for all colors. Numerator = red sales, denominator = total sales.
If that cannot be done in a beast mode, is there a way through other functionality to represent the % of total for a given column within a pivot table card? As in the value in a row divided by the sum of that column?
2) Is there a way with beast modes to calculate period over period trend? E.g. using a pivot table card If I had Color (Red) in the rows, and Months (Jan, Feb, March...Dec.) in the columns I would want to be able to calculate the % change month over month, in an excel formula it would be: (Red February Sales / Red January Sales) 1 copy that formula across to get MoM trend %, how do you do this in DOMO? I would imagine people report on these types of metrics with domo. I have quite a bit of experience with Power BI and Tableau, but still learning DOMO.
Any Help would be wonderful! Thank you in advance!
Comments

Hi @Bwaalsh
1) It sounds like you're wanting to do a windowing function. This is possible within Domo as a beast mode however you need to have the feature switched on in your instance. If you don't have it you'll need to talk to your CSM.
Something like:
SUM(`Sales`) / SUM(SUM(`Sales`)) OVER (PARTITION BY `Color`)
2) Domo can do this internally within Analyzer / Card Editor using a Period over Period type graph and editing the values in the Date Selector (upper right of your canvas). You can defined which period type you're wanting and it will calculate it for you. If you're wanting more flexibility surrounding there is a more complex method of structuring your data in a different way so that you join to a date dimension table calculating the period types manually. I've written about this previously here: https://dojo.domo.com/discussion/comment/50540#Comment_50540
**Was this post helpful? Click Agree or Like below**
**Did this solve your problem? Accept it as a solution!**3 
+1 @GrantSmith except it sounds like you need to add a partition. @Bwaalsh,
sum(Sales) / sum(sum(sales)) over (partition by colors)
I actually just posted a video involving window functions (https://www.youtube.com/watch?v=Esnu1PSxRjM&t=35s)
Jae Wilson
Check out my 🎥 Domo Training YouTube Channel 👨💻
**Say "Thanks" by clicking the ❤️ in the post that helped you.
**Please mark the post that solves your problem by clicking on "Accept as Solution"3
Categories
 All Categories
 1.5K Product Ideas
 1.5K Ideas Exchange
 1.4K Connect
 1.1K Connectors
 285 Workbench
 4 Cloud Amplifier
 5 Federated
 2.7K Transform
 91 SQL DataFlows
 576 Datasets
 2.1K Magic ETL
 3.5K Visualize
 2.4K Charting
 619 Beast Mode
 25 App Studio
 33 Variables
 609 Automate
 155 Apps
 421 APIs & Domo Developer
 31 Workflows
 2 DomoAI
 29 Predict
 12 Jupyter Workspaces
 17 R & Python Tiles
 372 Distribute
 103 Domo Everywhere
 266 Scheduled Reports
 3 Software Integrations
 100 Manage
 97 Governance & Security
 4 Domo University
 15 Product Releases
 Community Forums
 37 Getting Started
 28 Community Member Introductions
 91 Community Announcements
 4.8K Archive