Forum Discussion
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
- Value at other dates = Actual value at that date/Actual value at 1.1.2012 * 100
Do you have any suggestion on how to create the measures for calculating this? Thanks a lot!
Hi Anonymous,
You can do ti using this simple steps:
- Add a calendar table to your data but leave it as a standalone table (do not make any relationship with other tables)
- Add a slicer to your report based on the Calendar Table
- 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 - 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
23 Replies
- MFelixSuper User
Hi Anonymous,
You can do ti using this simple steps:
- Add a calendar table to your data but leave it as a standalone table (do not make any relationship with other tables)
- Add a slicer to your report based on the Calendar Table
- 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 - 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
- AnonymousNot applicable
Hi,
Thanks for your suggestion. My dataset consists of many different items, and I need to have index value for each of the items. However, this methods sum up all value. Do you have any ideas how to solve that?- MFelixSuper User
Hi Anonymous,
I just made a simple table that not very fancy calculation what type of calculation you want in the Total row?
Regards,
MFelix
- AnonymousNot applicable
Hello!
Thanks for a good answer! My dataset, however, consist of various goods, ranging from A-I. Do you have any idea on how i can filter the index based on this to show for example only A compared to C?Thanks!
- MFelixSuper User
Hi Anonymous,
When you mean that you want to have the comparition with A with C do you mean that the base value will be the the category or do you want it to continue to be the data but add next level of calculation to your index calculation?