>> Download the sample (Power BI)
This sample shows the total sales of the highest-buying customers (the top 30%), as a % of total sales, for each region and in each quarter.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Customer
Section titled “Measures - Sales & Customer”Ranking of Customers based on Total Sales
Section titled “Ranking of Customers based on Total Sales”Ranking of Customers based on Total Sales =RANKX ( ALL ( Customer_Table ), [Total Sales],, DESC )Sales from Top 30% of Customers as a % of Total Sales
Section titled “Sales from Top 30% of Customers as a % of Total Sales”Sales from Top 30% of Customers as a % of Total Sales =DIVIDE ( [Total Sales from Top 30% of Highest Ranked (based on Sales) Customers], [Total Sales], 0)Total No. of Distinct Customers
Section titled “Total No. of Distinct Customers”Total No. of Distinct Customers =DISTINCTCOUNT ( Sales_Table[Customer] )Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )Total Sales from Top 30% of Highest Ranked (based on Sales) Customers
Section titled “Total Sales from Top 30% of Highest Ranked (based on Sales) Customers”Total Sales from Top 30% of Highest Ranked (based on Sales) Customers =VAR TopCustomers = ROUND ( 0.3 * [Total No. of Distinct Customers], 0 )RETURN CALCULATE ( [Total Sales], FILTER ( VALUES ( Sales_Table[Customer] ), RANKX ( VALUES ( Sales_Table[Customer] ), [Total Sales],, DESC ) <= TopCustomers ) )Total Sales from Top 30% of Highest Ranked (based on Sales) Customers (Customer Context)
Section titled “Total Sales from Top 30% of Highest Ranked (based on Sales) Customers (Customer Context)”Total Sales from Top 30% of Highest Ranked (based on Sales) Customers (Customer Context) =SUMX ( Customer_Table, IF ( ISBLANK ( [Total Sales] ), BLANK (), IF ( RANKX ( ALL ( Customer_Table ), [Total Sales],, DESC ) <= ( CALCULATE ( [Total No. of Distinct Customers], ALL ( Customer_Table ) ) * 0.3 ), [Total Sales], BLANK () ) ))Tables
Section titled “Tables”Calendar_Table
Section titled “Calendar_Table”Calendar_Table =GENERATE ( CALENDAR ( DATE ( 2017, 1, 1 ), DATE ( 2019, 12, 31 ) ), VAR currentDay = [Date] VAR Day = DAY ( currentDay ) VAR Month = MONTH ( currentDay ) VAR Year = YEAR ( currentDay ) RETURN ROW ( "Day", day, "Month", month, "Year", year ))