7 Replies Latest reply on Apr 19, 2018 6:59 AM by Darshan Dey

# Quadrant Colors using Avg Function

Hi,

I am trying to color the points based on their Quadrant based on the Avg of X-Axis & Avg of Y-Axix.

Currently Im getting the colors but the problem is Tableau is considering entire data and giving the Avg of Y-Axix, I want Avg of the data which is present after putting some filter.

Can we use WINDOWS_AVG here?

Screenshot for Reference:

1. Output:

2. Color Position Formula which im currently using:

3. Average of X & Y Axis Formula:

• ###### 1. Re: Quadrant Colors using Avg Function

Hi Darshan,

Consider the difference between:

IF           [WD (Max)]    < = ...etc

IF SUM( [WD (Max)] )  < = ...etc

The X-axis is SUM([WD (Max)]), but with the current calc SKUs are being colored based on individual records of [WD (Max)].  A SKU with three records of 20% (each) for WD (Max) will correctly be colored orange, and will correctly chart the sum at 60%.  Also, if this SKU has a 4th record with a WD (Max) of 100%, then a separate, second point will be plotted for this SKU ( this one showing as green).  Correct by using SUM() in the calc for [SKU Quadrant].  The same logic applies to Velocity.

• ###### 2. Re: Quadrant Colors using Avg Function

Hi Eric

Thank you for your reply but the solution you have provided is not working in my current scenario.

• ###### 3. Re: Quadrant Colors using Avg Function

Good morning

see the attached possible solution - I had to use superstore data but it should serve as an example

it will return  this

step 1 is determining the fixed avg sales and quantity (Note - if your real data is dependant on several dimension you will need to include them in the LOD)

and

then step 2 is the quadrant designator formula

then just create the viz

set the ref lines as shown

Jim

If this posts assists in resolving the question, please mark it helpful or as the 'correct answer' if it resolves the question. This will help other users find the same answer/resolution.  Thank you.

1 of 1 people found this helpful
• ###### 4. Re: Quadrant Colors using Avg Function

Hi Jim,

Problem is solved by your suggestion

• ###### 5. Re: Quadrant Colors using Avg Function

Hi Jim,

Thank you for the help.

As you suggested earlier, The I have got the 4 Quadrants for a particular period but in this scenario, I have multiple periods but required same Identifiers,

The formula which I'm using to Identify Quadrants: (It will work properly if we have a single period)

Is there any option to fix that formula on period="YTD_CY"

Screenshot for reference :

In an ideal scenario the Blank SKUs in YTD_CY column, They shouldn't be there.

• ###### 6. Re: Quadrant Colors using Avg Function

Good morning

this is getting to be beyond the purpose of the Forum - I see you are in Mexico and work for a major corporation - suggest you find a local Tableau resource to work with directly

Thanks

Jim

• ###### 7. Re: Quadrant Colors using Avg Function

Thank you for the suggestion !