Jul 28, 2024
total_sales = CALCULATE(SUM(SalesAmount))
cumulative_spend = CALCULATE(
total_sales,
WINDOW(
FROM_VALUE = 0,
ABSOLUTE,
TO_VALUE = 2,
RELATIVE = 0,
ADDCOLUMNS(
ALLSELECTED(CustomerName),
"Cast",
total_sales,
ORDER BY Cost DESC
)
)
)
cumulative_spend_percentage =
VAR all_sales = CALCULATE(SUM(total_sales), ALL(GrocerySaleTable))
RETURN
DIVIDE(cumulative_spend, all_sales)
filter =
IF(cumulative_spend_percentage <= 0.3, TRUE, FALSE)
Top