2 Replies Latest reply on Oct 15, 2019 9:14 AM by Fernando Visani

# Weighted Average Aggregated Measure

Hi.

I have a dashboard in which I show the Total for the Absolute Accuracy of Actuals vs Forecast. Now I need to show the total Weighted Average of this KPI for the selected period.

The way I'm calculating the Accuracy KPI is as follows:

As I want to show the total and I have other dimensions in the table as well, I can't do a simple Actuals/Forecast-1, so I have to aggregated it.

The thing is that, when trying to calculate the WA in the standard way, which is SUM(KPI_1 * Weight)/SUM(Weight), I get an error of Aggregated/Non-Aggregated. When trying to use LOD, I got somewhere (it gives me 31.7%):

But couldn't make it match the value I have in Excel:

Could you help me make the same weighted average in Tableau?

Attached you may see a sample workbook and the database.

Tks.

• ###### 1. Re: Weighted Average Aggregated Measure

Fernando,

I'm not sure, but I'm thinking you might need to LOD over the [Date]

and then take the average:

{ FIXED :AVG(

{FIXED [Date]:([ABS Accuracy]*SUM([Actual Units CY]))/SUM([Actual Units CY])}

)}

Also, I think the [Date] Filter might need to be added to context.

It came out as 33.7% which seems closer.

Weighted Average Aggregated Measure

• ###### 2. Re: Weighted Average Aggregated Measure

That helped a little, but couldn't get the same WA in my official dashboard. I tried to do a dashboard as close as possible on what we have here. We have 2 parameters for selecting periods and years and a filter for each of them. Don't know if this could be the issue.

Now, my weighted average in Excel should look like this one below:

Attached you may see an updated one based on what you sent me.

Tks.