Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Dynamic Consumer Price Index (CPI) by Date Slicer

  I'm trying to create a dynamic calculation of Consumer Price Index (CPI) that sets the base year depending on my Date Slicer.   Index is calculated by the following principle: (Year 2 of $250,0...
  • v-piga-msft's avatar
    7 years ago

    Hi Anonymous,

     

    Please try the formula below.

     

    Consumer Price Index Dynamic =
    VAR yearbase =
        CALCULATE ( MIN ( 'tblCPI'[Year] ), ALLSELECTED ( tblCPI ) )
    RETURN
        DIVIDE (
            CALCULATE ( SUM ( tblCPI[Consumer Price Index 1980] ) ),
            CALCULATE (
                SUM ( tblCPI[Consumer Price Index 1980] ),
                FILTER ( ALL ( tblCPI ), tblCPI[Year] = yearbase )
            )
        )
            * 100

     

    Best Regards,

    Cherry