Skip to main content

Hello there,

 

I have created a simple calculation in the attached workbook to find the percentage of employees that have participated in each training type (this is a fragment of the actual data, with the columns independently resorted):

 

Percentage Trained =

[Number of Records] / 88

 

I have created another calculation to drag to the color tile:

 

Legend Colors =

IF SUM([Percentage Trained]) >= 0.85 THEN "85% +"

    ELSEIF SUM([Percentage Trained]) >= 0.7 AND SUM([Percentage Trained]) < 0.85 THEN "70% - 84%"

    ELSEIF SUM([Percentage Trained]) < 0.7 THEN "69% and below"

    END

 

As you can see below, the colors don't match the values specified in the Legend Colors calculation, so I have to assume that I am not feeding Tableau the correct percentage values.

 

Any idea what I am missing?

 

Using and IF statement to evaluate percentages and provide color coding

 

Any help is greatly appreciated!

 

Thanks,

 

-Marlon

4 answers
0/9000