1 Reply Latest reply on Apr 26, 2018 2:19 PM by Deepak Rai

    Divide one percent of total calculation by another split on dimensions

    James Tan



      I'm trying to figure out how to divide one table calculation by another split on a dimension in Tableau 10.3.10.The table calculation I want to use is percent of total using pane (down). The formula for this on the shelf is COUNT([price]) / TOTAL(COUNT([price])). For example if there are two countries US and Canada, and I'm looking at the percent of total sales within each country made up by different items, I want to divide each item with the US percentage over the Canadian percentage, so I can see which items make up more of the distribution in each country.


      When I try to create a calculated field filtering for the dimension I'm splitting on, it says it cannot mix aggregate and non-aggregate arguments with this function. I've tried using a bunch of fixed fields like the count for each item and the total fixed by the correct dimensions, but in this case, I can't filter out items and have the total be recalculated and the percentage be only for those items I haven't filtered out rather than the overall total.


      Is there any other way to do this?