In this scenario we have Lines, Categories and Revenue objects from the eFashion database and we want to highlight top 40% (based on revenue) of Categories.
First we need to count how many Categories we have in each Line and calculate what 40% of that value is:
=COUNT([Category]) IN SECTION *0.4
Next we calculate a rank of Categories based on Revenue.
And finally compare these 2 numbers in an alerter. Notice that we also highlight bottom 40%.
Here is the full table with all calculations and final results.