>> Download the sample (Power BI)
This sample shows how:
(i) Actual Total Sales compare to
(ii) A pre-determined budget (where the budget has been allocated monthly using a monthly percentage weighting)
Dashboard - Snippet
Section titled “Dashboard - Snippet”
Data Model - Snippet
Section titled “Data Model - Snippet”
Measures - Sales, Budget, and Calendar Time
Section titled “Measures - Sales, Budget, and Calendar Time”Actuals vs Budget w/Weightings
Section titled “Actuals vs Budget w/Weightings”Actuals vs Budget w/Weightings =[Total Sales] - [Budget Allocation w/Weightings]Budget Allocation w/Weightings
Section titled “Budget Allocation w/Weightings”Budget Allocation w/Weightings =VAR DaysinDateContext = COUNTROWS ( Calendar_Table ) //Finds how many dates in date contextVAR DaysinPeriod = CALCULATE ( COUNTROWS ( Calendar_Table ), ALL ( Calendar_Table ), VALUES ( Calendar_Table[Month & Year] ) ) //Finds how many dates within each MonthVAR Seasonality = [Seasonality Measure]VAR TotalBudget = LOOKUPVALUE ( Budget_Table[Annual Budget], Budget_Table[Year], [Selected Year] ) * Seasonality //Sums up the Total BudgetRETURN ( DaysinDateContext / DaysinPeriod ) * TotalBudget//Retrieves Budget Allocation over any date contextCurrent Month
Section titled “Current Month”Current Month =IF ( ISFILTERED ( Calendar_Table[Date].[Month] ), VALUES ( Calendar_Table[Date].[Month] ), FORMAT ( LASTDATE ( Calendar_Table[Date] ), "MMMM" ))Current Month No
Section titled “Current Month No”Current Month No =IF ( ISFILTERED ( Calendar_Table[Date].[Month] ), VALUES ( Calendar_Table[Date].[MonthNo] ), MONTH ( LASTDATE ( Calendar_Table[Date] ) ))Seasonality Measure
Section titled “Seasonality Measure”Seasonality Measure =IF ( ISFILTERED ( Calendar_Table[Date].[Month] ), AVERAGEX ( FILTER ( 'Budget Weightings', 'Budget Weightings'[Month Name] = [Current Month] ), 'Budget Weightings'[Monthly Weighting] ), IF ( ISFILTERED ( Calendar_Table[Date].[Quarter] ), AVERAGEX ( FILTER ( 'Budget Weightings', 'Budget Weightings'[Month No] = [Current Month No] ), 'Budget Weightings'[Monthly Weighting] ) + AVERAGEX ( FILTER ( 'Budget Weightings', 'Budget Weightings'[Month No] = [Current Month No] - 1 ), 'Budget Weightings'[Monthly Weighting] ) + AVERAGEX ( FILTER ( 'Budget Weightings', 'Budget Weightings'[Month No] = [Current Month No] - 2 ), 'Budget Weightings'[Monthly Weighting] ), SUMX ( 'Budget Weightings', 'Budget Weightings'[Monthly Weighting] ) ))Selected Year
Section titled “Selected Year”Selected Year =VAR selectedyear = SELECTEDVALUE ( Calendar_Table[Year] )RETURN IF ( ISBLANK ( selectedyear ), "Multiple Years", selectedyear )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 ))