Skip to content

Top 2 selling products, by Sales and Sales Units – by Region

>> Download the sample (Power BI)

This sample determines what the top 2 selling products are,

(i) By sales, and (ii) By sales units,

for each region.

Total Sales =
SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )

Total Sales of Top 2 Best Selling Products

Section titled “Total Sales of Top 2 Best Selling Products”
Total Sales of Top 2 Best Selling Products =
CALCULATE (
[Total Sales],
TOPN ( 2, ALL ( Products_Table[Products] ), [Total Sales] ),
VALUES ( Products_Table[Products] )
)

Total Sales Units of Top 2 Best Selling Products

Section titled “Total Sales Units of Top 2 Best Selling Products”
Total Sales Units of Top 2 Best Selling Products =
CALCULATE (
CALCULATE ( SUM ( Sales_Table[Quantity] ) ),
TOPN (
2,
ALL ( Products_Table[Products] ),
CALCULATE ( SUM ( Sales_Table[Quantity] ) )
),
VALUES ( Products_Table[Products] )
)
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 )
)