Forum Discussion

ecoale's avatar
ecoale
Icon for Helper I rankHelper I
8 years ago
Solved

GEOMEAN???? :(

Hi my friends! I would need help with geometric mean...   I have a matrix with the number of students per year (2009/2017). In a plot I got the % variations YoY (Δ%),as following:  I used th...
  • OwenAuger's avatar
    OwenAuger
    8 years ago

    Hi again ecoale

    Thanks for the additional explanation. It sounds like you want to see the same constant geometric mean across all years.


    Try either of these measures:

     

    Geometric Mean of Δ =
    GEOMEANX ( ALLSELECTED ( ISCRITTI[AA] ), [Δ] )

     

    or

     

    Geometric Mean of Δ =
    CALCULATE ( GEOMEANX ( VALUES ( ISCRITTI[AA] ), [Δ] ), ALLSELECTED () )

    My original measure would have worked as a standalone measure on a card, but not when filtered on an individual year.

     

    Regards,

    Owen

  • OwenAuger's avatar
    OwenAuger
    8 years ago

    Glad to hear it worked :)

     

    For your N* measure you should be able to do something like this (it worked for me in a test model):

    N* =
    VAR y0 =
        FIRSTNONBLANK ( ALLSELECTED ( ISCRITTI[AA] ), 0 )
    VAR y =
        SELECTEDVALUE ( ISCRITTI[AA] )
    VAR N0 =
        CALCULATE ( COUNT ( ISCRITTI[Student_ID] ), y0 )
    VAR Mg = [Mg]
    RETURN
        N0 * POWER ( Mg, y - y0 )

    I have used variables to make it quite clear what the components of the calculation are.

     

    Essentially we just need to multiply the initial Student Count by Mg raised to the power of the difference between last and first years.

     

    Regards,

    Owen