Skip to content

Comparison of Average Monthly Sales to Average Monthly Sales from LY – by region

>> Download the sample (Power BI)

This sample compares average monthly sales for the current year against average monthly sales for the prior year, for each region.

Average Sales per Month =
AVERAGEX ( VALUES ( Calendar_Table[Month & Year] ), [Total Sales] )
Average Sales per Month (CY - LY) =
[Average Sales per Month] - [Average Sales per Month LY]
Average Sales per Month LY =
CALCULATE (
[Average Sales per Month],
SAMEPERIODLASTYEAR ( Calendar_Table[Date] )
)
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 )
)