>> Download the sample (Power BI)
This sample shows the average of monthly sales, year to date.
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales & Time
Section titled “Measures - Sales & Time”Monthly Average Sales
Section titled “Monthly Average Sales”Monthly Average Sales =AVERAGEX ( VALUES ( Calendar_Table[Month & Year] ), [Total Sales] )Total Sales
Section titled “Total Sales”Total Sales =SUMX ( Sales_Table, Sales_Table[Quantity] * Sales_Table[Unit Price] )YTD Monthly Average
Section titled “YTD Monthly Average”YTD Monthly Average =CALCULATE ( [Monthly Average Sales], FILTER ( ALL ( Calendar_Table ), Calendar_Table[Month] <= MAX ( Calendar_Table[Month] ) && Calendar_Table[Year] = MAX ( Calendar_Table[Year] ) ))YTD Total Sales
Section titled “YTD Total Sales”YTD Total Sales =TOTALYTD ( [Total Sales], 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 ))