1 Reply Latest reply on Nov 5, 2018 1:27 PM by Hari Ankem

# Calculate Distinct Counts for Measure Value

Hello Tableau users, i'm going through a Use case Scenario Where I want to calculate Distinct Count for a Measure Value, for example in below Original Data Set I have two columns Cust ID and Type we can Calculate Distinct Count i.e. there are 6 Distinct Customers, in my below Explanation Table below Acct 4 was exposed 1 Time, Acct 2 was exposed 2 times, Acct 1 was 3 times and Acct 5 & 6 was exposed 5 times,

so my use case is I want to Calculate the number of Times Exposed as Dimension and Calculate the Distinct Counts of Customer ID's that were exposed so many N times which is Expected Output Table from the Original Data Set Below Can somebody please help me in this would appreciate it. I have attached an WB

Original Data Set

 Cust ID Type Acct 1 Exposed Acct 1 Exposed Acct 1 Exposed Acct 2 Exposed Acct 2 Exposed Acct 3 Exposed Acct 3 Exposed Acct 3 Exposed Acct 3 Exposed Acct 4 Exposed Acct 5 Exposed Acct 5 Exposed Acct 5 Exposed Acct 5 Exposed Acct 5 Exposed Acct 6 Exposed Acct 6 Exposed Acct 6 Exposed Acct 6 Exposed Acct 6 Exposed

Explanation Table

 Number of times Exposed Cust ID 1 Acct 4 2 Acct 2 3 Acct 1 5 Acct 5, Acct 6

Output Expected In Tableau

 Number of times Exposed Distinct Count of Cust ID 1 1 2 1 3 1 5 2
• ###### 1. Re: Calculate Distinct Counts for Measure Value

Create a calculated field as shown below and use it as a dimension.

Hope this helps.