>> Download the sample (Power BI)
This sample compares Total Sales and Total Sales LY, based on a discrete grouping of customers (e.g. Average Growth, Great Growth, Poor Growth), depending on each customer’s sales growth.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Customers
Section titled “Measures - Sales & Customers”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 each Customers Sales Growth)
Section titled “Total Sales (Disaggregated into Groups based on each Customers Sales Growth)”Total Sales (Disaggregated into Groups based on each Customers Sales Growth) =CALCULATE ( [Total Sales], FILTER ( VALUES ( Customer_Table[Customer] ), COUNTROWS ( FILTER ( 'Customer Sales Growth Group', [Total Sales Growth %] >= 'Customer Sales Growth Group'[Min] && [Total Sales Growth %] < 'Customer Sales Growth Group'[Max] ) ) > 0 ))Total Sales Growth %
Section titled “Total Sales Growth %”Total Sales Growth % =DIVIDE ( [Total Sales] - [Total Sales LY], [Total Sales LY], 0 )Total Sales LY
Section titled “Total Sales LY”Total Sales LY =CALCULATE ( [Total Sales], SAMEPERIODLASTYEAR ( Calendar_Table[Date] ) )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 ))