Search code examples
tableau-apimedianaggregates

Median of CAGR in Tableau


New to Tableau ... I have a calculated field that calculates the CAGR for the last year in Tableau. I want to create another column that calculates the median of the CAGRs but get the error that the CAGR is already an aggregate and cannot be further aggregated.

This is what I have so far for the CAGR:

IF INDEX() = 5 // if there is at least 5 years of data
then ZN(POWER(ZN(SUM([Total Conferrals]))/LOOKUP(ZN(SUM([Total Conferrals])), FIRST()),ZN(1/(INDEX()-1))) - 1)
ELSE 0
END

Is there a way to get Median(CAGR)?


Solution

  • For already Aggregated measures Tableau does not allow further aggregation .

    You should use WINDOW-CALC for these types of scenarios .

    In your particular case, you may want to use WINDOW_AVERAGE('AGGREGATE FUNCTION')

    Let me know if this works for you .