>> Download the sample (Power BI)
This sample compares Total Sales against profit margins, based on a discrete grouping of customers (e.g. Bottom, Middle and Top), according to their percentile ranking of total sales made.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales, Profits, & Customers
Section titled “Measures - Sales, Profits, & Customers”Profit Margin
Section titled “Profit Margin”Profit Margin =DIVIDE ( [Total Profits], [Total Sales], 0 )Ranking of Customers based on their Total Sales
Section titled “Ranking of Customers based on their Total Sales”Ranking of Customers based on their Total Sales =IF ( ISBLANK ( [Total Sales] ), BLANK (), RANKX ( FILTER ( ALL ( Customer_Table ), NOT ( ISBLANK ( [Total Sales] ) ) ), [Total Sales], , ASC ))Total Costs
Section titled “Total Costs”Total Costs =SUMX ( Sales_Table, Sales_Table[Unit Cost] * Sales_Table[Quantity] )Total Profits
Section titled “Total Profits”Total Profits =[Total Sales] - [Total Costs]Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )Total Sales (Disaggregated into Groups based on the each Customers Percentile Ranking of Total Sales made)
Section titled “Total Sales (Disaggregated into Groups based on the each Customers Percentile Ranking of Total Sales made)”Total Sales (Disaggregated into Groups based on the each Customers Percentile Ranking of Total Sales made) =VAR RankingDimension = VALUES ( Sales_Table[Customer] )VAR TotalCustomers = CALCULATE ( COUNTROWS ( Customer_Table ), FILTER ( ALL ( Customer_Table[Customer] ), [Total Sales] > 0 ) )VAR CustomerRank = [Ranking of Customers based on their Total Sales]RETURN CALCULATE ( [Total Sales], FILTER ( RankingDimension, COUNTROWS ( FILTER ( 'Customer Grouped into Percentile Ranking Groups', CustomerRank > TotalCustomers * 'Customer Grouped into Percentile Ranking Groups'[Low] && CustomerRank <= TotalCustomers * 'Customer Grouped into Percentile Ranking Groups'[High] ) ) > 0 ) )Tables
Section titled “Tables”Calendar_Table
Section titled “Calendar_Table”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 ))