Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Cascade Calculation

Hi everyone,   I've had some issues about te calculation below. Here is a sample example. I have two tables, sales and price.   Price Market Limit Volume Value1 Value2 Residencial 10 ...
  • Anonymous's avatar
    Anonymous
    7 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