/* we alreayd have a profit column */
TeamIncrementalProfit
=CALCULATE(
SUM( Sales[Profit] ),
ALLEXCEPT( Sales, Sales[Team] ),
Sales[Profit] >= EARLIER( Sales[Profit] )
)
/* team total profit */
=CALCULATE(
SUM( Sales[Profit] ),
ALLEXCEPT( Sales, Sales[Team] ) )
/* incremental pct */
=DIVIDE(Sales[TeamIncrementalProfit],Sales[TeamTotalProfit])
/* class calculation */
=SWITCH( TRUE(),
Sales[TeamIncrementalPct] <= 0.8, "A",
Sales[TeamIncrementalPct]<=0.9, "B",
"C" )
/* we have a column with normal profit figures, we need to calculate a column with incremental profit */
IncrementalProfit=
VAR CurrentProfit = Sales[Profit]
RETURN
SUMX (
FILTER( Sales,
Sales[Profit] >= CurrentProfit),
Sales[Profit]
)
/* next formula will get total profit overall for the company */
TotalProfit =SUM(Sales[Profit])
/* to ge the incremental pct below formula */
=DIVIDE( [IncrementalProfit], [TotalProfit] )
/* to get the class */
Class=
SWITCH( TRUE(),
Sales[IncrementalPct] <= 0.8, "A",
Sales[IncrementalPct]<=0.9, "B",
"C"
)