Skip to content

Sales to New Customers Only, and Sales made only to Old Customers

>> Download the sample (Power BI)

This sample shows, side by side: (i) Sales to new customers only, and
(ii) Sales made only to old customers

Total Sales =
SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )
Total Sales made only to Old Customers =
[Total Sales] - [Total Sales to New Customers Only]
Total Sales to New Customers Only =
VAR Customers =
VALUES ( Customer_Table[Customer] )
RETURN
CALCULATE (
[Total Sales],
FILTER (
Customers,
CALCULATE (
COUNTROWS ( Sales_Table ),
FILTER (
ALLSELECTED ( Calendar_Table ),
Calendar_Table[Date] < MIN ( Calendar_Table[Date] )
)
)
= 0
)
)
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 )
)