0 Replies Latest reply on Oct 8, 2013 12:01 PM by Juracy Americo

# How to Count distinct between 2 period - Sales Strike

Hi Tableau Community,

My guess is that  there should be a fairly easy way to do this.

What I’m trying to create is a KPI call sales strike where I need to count distinct within a customer if there is any sales in our subbrands  in the last 2 periods (dimension).

Example:

Scenario 1 - Customer1  bought subbrand01 in

P09 - 10 unit

P10 -  2 unit

Consider  P09 as 1 and P10 as 1 .  I need a formula to be able to count it range as 1

P09 + P10 = 1

Scenario 2 - Customer1  bought subbrand01 in

P09 - 0 unit

P10 -  2 unit

Consider P09 as 0 and P10 as 1.  I need a formula to be able to count it range as 1.

P09 + P10 = 1

Scenario 3 - Customer1  bought subbrand01 in

P09 - 1 unit

P10 -  0 unit

Consider P09 as 1 and P10 as 0. I need a formula to be able to count it range as 1.

P09 + P10 = 1

Scenario 4 - Customer1  bought subbrand01 in

P09 - 0 unit

P10 -  0 unit

Consider P09 as 0 and P10 as 0.  I need a formula to be able to count it range as 0.

P09 + P10 = 0

So I need to do that in one shoot , look last period and the actual period and see if we sold any unit and count as one.

In the attachment I have a workbook sample with a fake dataset. With the sales strike formula but I’m not able to make it work in the way that I need.

Any help will be appreciated