Skip to content

Total Sales made over time, to Top 3 buying Customers

>> Download the sample (Power BI)

This sample shows sales over time by quarter, but only to the top 3 buying customers.

Total Sales =
SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )
Total Sales to Top 3 Buying Customers =
CALCULATE (
[Total Sales],
FILTER (
VALUES ( Customer_Table[Customer] ),
IF (
RANKX ( ALL ( Customer_Table[Customer] ), [Total Sales],, DESC ) <= 3,
[Total Sales],
BLANK ()
)
)
)
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 )
)