简体   繁体   中英

How can I calculate a distinct count of a dimension in Tableau?

I have Googled this and searched the Tableau forums but I'm coming up empty. How can I calculate a distinct count of City Names using Tableau?

在此处输入图片说明

Is it not:

  1. Create Calculated Field Analysis->Create Calulatated Field
  2. Name it and enter the below formula

    COUNTD([City Name])
  3. Then pull that into your measures?

This should give you your total count. Or am I missing something in your question?

Another easy way to tackle this problem:

"we need two information as city name and city name (Count Distinct)"

1.To get city name Select [city name] and drag it to row shelf.

2.Again Drag city name into row shelf and Right click on city name in row shelf and Go into measures and select Count Distinct.

Describe in the below link about how to do count Distinct of city name https://i.stack.imgur.com/gpnrj.png

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM