Forum Discussion
Anonymous
1 year agoNot applicable
Cumulative sum
Hi everyone, I’m trying to implement a logic where I classify customers based on their cumulative contribution to total revenue. My goal is to: Classify a customer as "A" if their revenue contribu...
- 1 year ago
Hello Anonymous,
Can you please try the following:
1. Calculate the total revenue
TotalRevenue = SUM(RevenueTable[Revenue])2. Calculate Each Customer's Contribution
RevenueContribution = DIVIDE(SUM(RevenueTable[Revenue]), [TotalRevenue])3. Rank Customers by Revenue, then calculate the Cumulative Revenue
CustomerRank = RANKX( ALL(RevenueTable[Customer]), SUM(RevenueTable[Revenue]), , DESC )CumulativeRevenue = VAR CurrentRank = [CustomerRank] RETURN CALCULATE( SUMX( FILTER( ALL(RevenueTable[Customer]), [CustomerRank] <= CurrentRank ), [RevenueContribution] ) )4. Classify Customers
CustomerClassification = SWITCH( TRUE(), [CumulativeRevenue] <= 0.75, "A", [CumulativeRevenue] <= 0.85, "B", "C" )Hope this helps.
suparnababu8
1 year agoSuper User
Hi Anonymous
Can you share the pbix file with sample data with out any sensitive information with all your output reuiqrements?