Skip to content

Total Sales, Min & Max of a particular Sales Order, Min & Max Sales by Product

>> Download the sample (Power BI)

This sample shows:

(i) Total Sales
(ii) The minimum and maximum sales of a particular sales order, for each customer
(iii) The minimum and maximum sales of a particular product, for each customer (the figure here may include several sales orders)

MAXX Order Sales =
MAXX ( Sales_Table, Sales_Table[Quantity] * Sales_Table[Unit Price] )
MAXX Total Sales by Product =
MAXX ( VALUES ( Products_Table[Products] ), [SUMX Total Sales] )
MINX Order Sales =
MINX ( Sales_Table, Sales_Table[Quantity] * Sales_Table[Unit Price] )
MINX Total Sales by Product =
MINX ( VALUES ( Products_Table[Products] ), [SUMX Total Sales] )
SUMX 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 )
)