Forum Discussion
RJB0412
3 years agoRegular Visitor
Calculation across a bridge Table
We are trying to analyse turnover projections based on a number of scenarios of price and sales volumes. We have 2 tables, one for price scenarios and one for volume scenarios. We can't join the 2 ta...
- 3 years ago
I don't bother to create such a bridge table given that the composite key consists of so many columns. TREATAS() does the trick.
Revenue = SUMX( Volumes, Volumes[Qty] * CALCULATE( MAX( Prices[Price] ), TREATAS( CALCULATETABLE( SUMMARIZE( Volumes, Volumes[Year], Volumes[Week], Volumes[Product],Volumes[Xxxx] ) ), Prices[Year], Prices[Week], Prices[Product],Prices[Xxxx] ) ) )
ThxAlot
Super User
3 years agoI don't bother to create such a bridge table given that the composite key consists of so many columns. TREATAS() does the trick.
Revenue =
SUMX(
Volumes,
Volumes[Qty]
* CALCULATE(
MAX( Prices[Price] ),
TREATAS(
CALCULATETABLE(
SUMMARIZE(
Volumes,
Volumes[Year], Volumes[Week], Volumes[Product],Volumes[Xxxx]
)
),
Prices[Year], Prices[Week], Prices[Product],Prices[Xxxx]
)
)
)RJB0412
3 years agoRegular Visitor
This did the trick nicely. Thanks