>> Download the sample (Power BI)
This sample shows the sales of the top N and bottom customers dynamically, in a standard table, a 100% bar chart and a regional donut chart.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales
Section titled “Measures - Sales”Bottom Customer Sales Correct Total
Section titled “Bottom Customer Sales Correct Total”Bottom Customer Sales Correct Total =SUMX ( SUMMARIZE ( Products_Table, Products_Table[Products], "Bottom", [Bottom Customers] ), [Bottom])Bottom Customers
Section titled “Bottom Customers”Bottom Customers =CALCULATE ( [Total Sales], TOPN ( [Total Customers] - [Customer Rank Value], FILTER ( VALUES ( Customer_Table[Customer] ), [Total Sales] > 0 ), [Total Sales], ASC ))Top Customer Sales Correct Total
Section titled “Top Customer Sales Correct Total”Top Customer Sales Correct Total =SUMX ( SUMMARIZE ( Products_Table, Products_Table[Products], "Top", [Top Customers] ), [Top])Top Customers
Section titled “Top Customers”Top Customers =CALCULATE ( [Total Sales], TOPN ( 'Customer Rank'[Customer Rank Value], VALUES ( Customer_Table[Customer] ), [Total Sales], DESC ))Total Customers
Section titled “Total Customers”Total Customers =COUNTROWS ( VALUES ( Sales_Table[Customer] ) )Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Quantity] * Sales_Table[Unit Price] )Customer Rank Value
Section titled “Customer Rank Value”Customer Rank Value =SELECTEDVALUE ( 'Customer Rank'[Customer Rank] )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 ))Customer Rank
Section titled “Customer Rank”Customer Rank =GENERATESERIES ( 1, 20, 1 )