Skip to content

Highest Buying Customer per Product

>> Download the sample (Power BI)

This sample shows:

(i) The highest-buying customer per product
(ii) The sales of the highest-buying customer per product

Top Customer Name =
IF (
[Top Customer Revenue] = BLANK (),
BLANK (),
MAXX (
TOPN (
1,
SUMMARIZE ( Customer_Table, Customer_Table[Customer], "Revenue", [Total Sales] ),
[Revenue], DESC
),
Customer_Table[Customer]
)
)
Top Customer Revenue =
MAXX (
TOPN (
1,
SUMMARIZE ( Customer_Table, Customer_Table[Customer], "Revenue", [Total Sales] ),
[Revenue], DESC
),
[Revenue]
)
Total Sales =
SUMX ( Sales_Table, Sales_Table[Quantity] * Sales_Table[Unit Price] )
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 )
)