Skip to content

Customer Margins Contracting Over Time

>> Download the sample (Power BI)

This sample shows for which customers profit margins have been contracting over time, by:

Comparing:

  • Profit margins with growth in profit margins from the prior year

Other financial measures, such as total profits and total sales, are also shown to provide further insight.

Profit Margin =
DIVIDE ( [Total Profits], [Total Sales], 0 )
Profit Margin Growth =
[Profit Margin] - [Profit Margin LY]
Profit Margin LY =
CALCULATE ( [Profit Margin], DATEADD ( Calendar_Table[Date], -1, YEAR ) )
Total Costs =
SUMX ( Sales_Table, Sales_Table[Unit Cost] * Sales_Table[Quantity] )
Total Profits =
[Total Sales] - [Total Costs]
Total Sales =
SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )
Total Sales (CY vs LY). =
[Total Sales] - [Total Sales LY]
Total Sales LY =
CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( Calendar_Table[Date] ) )
Total Transactions =
COUNTROWS ( Sales_Table )
Total Transactions LY =
CALCULATE ( [Total Transactions], SAMEPERIODLASTYEAR ( Calendar_Table[Date] ) )
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 )
)