Last modified date: 20 Jul 2023
Environment
Tableau DesktopAnswer
Step 1: Create a WINDOW_SUM Calculation
- In Tableau Desktop, connect to Superstore sample data.
- Select Analysis > Create Calculated Field.
- In the Calculated Field dialogue box that opens, enter a name for the field. The COUNTD Alternative example workbook uses Distinct Customers.
- In the formula field, type the following, and then click OK:
WINDOW_SUM(MIN(1))
- Drag Distinct Customers from Measures to Columns.
- Drag the dimension for which you want the distinct count from Dimensions to Detail. The example workbook uses Customer Name.
- Right-click Distinct Customers on Columns, and then select Compute Using > Customer Name.
Step 2: Filter on Index
- Select Analysis > Create Calculated Field to create another calculated field.
- In the Calculated Field dialogue box, type a name for the field. The example workbook uses Table Calc Filter.
- In the formula field, type the following, and then click OK:
INDEX()=1
- Drag Table Calc Filter from Measures to Filters, and then click OK (do not tick any available option).
- Drag Product Category from Dimensions to Rows.
- Right-click Table Calc Filter on Filters, select Compute Using > Customer Name, select True, and then click OK.
Additional information
Any additional measures in the view will also need to use table calculations such as WINDOW_SUM.Thank you for providing your feedback on the effectiveness of the article.
Open new case
Continue searching
Knowledge Base
Community
Product help
Training and tutorials