Forum Discussion
Cascade Calculation
- Anonymous7 years ago
1. Add columns to Price table: Include all of the necessary information for the calculation (except the volume, which comes from the Sales table). Also, Add a key column like "Residential 10-25"
2. Add the same key column to the Sales table, so that it will match the new key column in the Price table.
3. Create a relationship between the two tables.
4. Create a Measure with SUMX: SUMX('Sales', <Formula>) //Refer to attributes in the Price table like this: Related(Price[Attribute])
Calc = SUMX('Sales', DIVIDE( Related(Price[Upper Value1] + ([Volume] - Related(Price[Lower Limit Volume])) * Related(Price[Upper Value2]) + Related([Lower Limit Volume]) * Related(Price[Lower Value2]), [Volume] ) )Cheers!
Nathan
1. Add columns to Price table: Include all of the necessary information for the calculation (except the volume, which comes from the Sales table). Also, Add a key column like "Residential 10-25"
2. Add the same key column to the Sales table, so that it will match the new key column in the Price table.
3. Create a relationship between the two tables.
4. Create a Measure with SUMX: SUMX('Sales', <Formula>) //Refer to attributes in the Price table like this: Related(Price[Attribute])
Calc = SUMX('Sales',
DIVIDE(
Related(Price[Upper Value1]
+ ([Volume] - Related(Price[Lower Limit Volume])) * Related(Price[Upper Value2])
+ Related([Lower Limit Volume]) * Related(Price[Lower Value2]),
[Volume]
)
) Cheers!
Nathan