Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

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

enter image description here

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


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
870 views
Welcome To Ask or Share your Answers For Others

1 Answer

Assuming that you are trying to get the percent of rows per "type", you can

  1. Drag your "Book1.csv (Count)" to your Text marks card
  2. From the marks card, click Percent of Total

Alternatively you can create a calculated field containing COUNT([Book1.csv]) / TOTAL(COUNT([Book1.csv]))

Example output from Superstore Dataset


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share

548k questions

547k answers

4 comments

86.3k users

...