Search code examples
tableau-api

Tableau Running Percentage of Total


Let's say I have this data:

good, bad
90, 10
95, 5
99, 1
98, 2

How can I get a tableau chart with these values:

90/100, 185/200, 284/300, 382/400
0.9, 0.925, 0.947, 0.955

The general idea is sum(good) / (sum(good) + sum(bad))


Solution

  • Just use the running_sum like this:

    RUNNING_SUM(sum([Good]))
    /
    RUNNING_SUM(sum([Good]+[Bad]))
    

    You should get somethinh like this (table as an example): enter image description here

    Or like a bar chart:

    enter image description here