Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
9 years ago
Solved

Calculate index base 100

Hello all, I would like to add indexing feature in my report. In short, user via filter can select which date they want to set as base (for example 1.1.2012). Then: - Value at 1.1.2012 = 100 - V...
  • MFelix's avatar
    9 years ago

    Hi Anonymous,

     

    You can do ti using this simple steps:

     

    1. Add a calendar table to your data but leave it as a standalone table (do not make any relationship with other tables)
    2. Add a slicer to your report based on the Calendar Table
    3. Create the following measure on your Data Table
      Index 100 =
      VAR Date_index =
          MIN ( 'Calendar'[Date] )
      RETURN
          SUM ( Data[Value] )
              / CALCULATE ( MAX ( Data[Value] ), Data[Date] = Date_index )
              * 100
    4. If you want to have dates previous to the selected date not being calculated make this changes to your measure:
      Index 100 =
      VAR Date_index =
          MIN ( 'Calendar'[Date] )
      RETURN
          SWITCH (
              TRUE (),
              MIN ( Data[Date] ) < Date_index, 0,
              SUM ( Data[Value] )
                  / CALCULATE ( MAX ( Data[Value] ), Data[Date] = Date_index )
                  * 100
          )

    Final result is below:

     

    Regards,

    MFelix