Forum Discussion
Indexing Using DAX
To calculate the company-wide index correctly while considering individual items, you can use the following DAX measure:
Company Index =
VAR TotalValue = SUM('Purchase Data'[Value])
RETURN
DIVIDE(
SUMX(
ADDCOLUMNS(
SUMMARIZE('Purchase Data', 'Purchase Data'[Receipt Date]),
"WeightedIndex",
[Index100] * SUM('Purchase Data'[Value])
),
[WeightedIndex]
),
TotalValue,
0
)
This measure calculates the company-wide index by first creating a table that summarizes the data for each unique receipt date, calculates the weighted index for each date, and then sums up these weighted indexes. This approach ensures that the index is correctly calculated for each unique receipt date and then aggregated for the company-wide index.
With this measure, your company-wide index should be correctly calculated, taking into account individual items and their respective values for each month.
Hi 123abc,
We have implemented your solution, but still are not able to get the desired result as the formula is not able to evaluate VALUES() function and populate a company wide index.
Please refer below screenshot.
Thank you for your help
Regards.