3 Replies Latest reply on Jun 23, 2018 9:56 PM by Mahfooj Khan

# Calculate leakage Percentage in Tableau

Hi guys,

I am struggling to do something very trivial in Tableau. I have the Transaction data at merchant - customer area level. I want to calculate leakage for all merchant regions.

 Merchant Region Customer Region Spend A A 62 A B 26 A C 46 B A 61 B B 81 B C 70 C A 25 C B 44 C C 26

This is how my data looks like. Leakage for Region A would be spend done by customer outside Region A. Calculation = (26+46)/(62+26+46). Similarly, for Region B would be (61+70)/(61+81+70). This calculation needs to be dynamic. I could have multiple merchant and customer regions. Please help. I have attached my packaged workbook for reference. I am using Tableau 2018.1 currently

• ###### 1. Re: Calculate leakage Percentage in Tableau

Something like the below and attached?

• ###### 2. Re: Calculate leakage Percentage in Tableau

Using The data Supplied by You, Here is thE leakage % and The Calculations

Thanks

Deepak

If it Helps, Pl mark it Helpful and CORRECT to Close Thread

• ###### 3. Re: Calculate leakage Percentage in Tableau

Hi,

Find my approach below,

Leakage %: IIF([Merchant Region]!=[Customer Region],[Spend],NULL)/{FIXED [Merchant Region]:SUM([Spend])}

Let us know if this help.

Mahfooj