Skip to content

Profits – Categorical Grouping by Profit Margin

>> Download the sample (Power BI)

This sample shows Total Profits based on a discrete grouping of products (into High, Medium and Low categories), based on each product’s Average Product Profit Margin.

Total Costs =
SUMX ( Sales_Table, Sales_Table[Unit Cost] * Sales_Table[Quantity] )
Total Profits =
[Total Sales] - [Total Costs]

Total Profits (Disaggregated into Groups based on each Product’s Average Profit Margin)

Section titled “Total Profits (Disaggregated into Groups based on each Product’s Average Profit Margin)”
Total Profits (Disaggregated into Groups based on each Product's Average Profit Margin) =
CALCULATE (
[Total Profits],
FILTER (
VALUES ( Products_Table[Average Product Profit Margin] ),
COUNTROWS (
FILTER (
'Product Profit Margin Group',
Products_Table[Average Product Profit Margin] >= 'Product Profit Margin Group'[Min]
&& Products_Table[Average Product Profit Margin] < 'Product Profit Margin Group'[Max]
)
) > 0
)
)
Total Sales =
SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )
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 )
)
Average Product Profit Margin =
DIVIDE ( [Total Profits], [Total Sales], 0 )