Reputation: 4388
I have a dataset in tableau where I would like to show the percent of each category.
Data
free use type date
10 5 A1 1/1/2021
20 1 A1 1/1/2021
40 2 B2 1/1/2021
60 3 B2 1/1/2021
Desired
type %
A1 50%
B2 50%
Doing
SUM( [type] ) / SUM( [type] )
However, because 'type' is a string, the calculation is not successful. Is there a way to showcase a groupby and to display the percent? Any suggestion is appreciated
Upvotes: 2
Views: 2522
Reputation: 546
Assuming that you are trying to get the percent of rows per "type", you can
Alternatively you can create a calculated field containing
COUNT([Book1.csv]) / TOTAL(COUNT([Book1.csv]))
Upvotes: 3
Reputation: 402
Please try using
count([type])/running_sum(count([type]))
as a calculated field and let me know if this helps.
Upvotes: -1