2 Replies Latest reply on Feb 14, 2019 1:07 AM by sajad.bhat

# Calculating Percentage

Hi All,

I have a requirement to calculate % and my data is like :

 %Completion Date Items Sequence Status 100% 14/02/2019 1 1 Completed 50% 2 2 Completed 3 In Progress 33% 15/02/2019 1 4 In Progress 5 Failed 6 Completed 0% 2 7 Failed 8 Failed

If out of 3 sequence 1 is completed then % is 33% like this I want to calculate at tableau level. I am not sure how to do this at run time. As this will be a live connection it should update according to status change

• ###### 1. Re: Calculating Percentage

Hi Anushree,

Find my approach based on LOD as reference below and stored in attached workbook version 10.5 located in the original thread.

LOD functionality is explained here: Overview: Level of Detail Expressions - Tableau

1. M1. Count Status Completed: {fixed [Date],[Items]:sum( if [Status]='completed' then 1 else 0 end)}

2. M2. Count Sequence: {fixed [Date],[Items]:countd([Sequence])}

3. M3. %: [M1. Count Status Completed]/[M2. Count Sequence]

4. Drag the required objects to the indicated locations.

Regards,

Norbert

1 of 1 people found this helpful
• ###### 2. Re: Calculating Percentage

Hi Anushree,

Hope you are expecting below results.

You can use below calc:

Calc1 as Completed Seq]-->

ZN(COUNTD(IF [Status]='Completed'

THEN [Sequence] END))

Calc2% as completed %-->

[Completed Seq]/TOTAL(COUNTD([Sequence]))

then quick table calc as per status. attached sample workbook for reference.