>> 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.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Calendar Time
Section titled “Measures - Sales & Calendar Time”Average Sales per Month
Section titled “Average Sales per Month”Average Sales per Month =AVERAGEX ( VALUES ( Calendar_Table[Month & Year] ), [Total Sales] )Average Sales per Month (CY - LY)
Section titled “Average Sales per Month (CY - LY)”Average Sales per Month (CY - LY) =[Average Sales per Month] - [Average Sales per Month LY]Average Sales per Month LY
Section titled “Average Sales per Month LY”Average Sales per Month LY =CALCULATE ( [Average Sales per Month], SAMEPERIODLASTYEAR ( Calendar_Table[Date] ))Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Unit Price] * Sales_Table[Quantity] )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 ))