>> Download the sample (Excel)
In this sample, we track Actuals against Budgeted amounts, for each P&L line, showing variances too, in a pivot table. Simple pivot tables are relatively easy to create and use, but for this file we also need to show additional lines, such as ‘Gross Profit’ and ‘Operating Income’, which do not appear in the source GL data. In effect, we need to create a highly customised pivot table.
Data Inputs
Section titled “Data Inputs”For this sample, we take the following data inputs:
Dimensions
Section titled “Dimensions”The dimension tables will be determined by the current structure of the business.
![]()
Accounts Structure
Section titled “Accounts Structure”This is where we define the layout and mappings of the P&L lines to different headings and sub-accounts.
![]()
![]()
General Ledger
Section titled “General Ledger”The GL here contains both the Actuals and Budgeted data for each month, so both datasets are already available in the same table, in an easy-to-use format.
![]()
P&L Tracking Measures
Section titled “P&L Tracking Measures”The following specific measures are shown:
- Actuals
- Budget
- Variance $
- Variance %
Dashboard - Snippet
Section titled “Dashboard - Snippet”Unlike most of our other samples, the final output here is presented in Excel itself, rather than through a Power BI dashboard, which is great for visuals but not as strong with tables. For pivot tables alone, it is a matter of preference.
The final file can also be downloaded here, if you want to review the formulae in detail:
>> Download the sample (Excel)
![]()
Data Model - Snippet
Section titled “Data Model - Snippet”The final data model used is shown here:
![]()
Measures
Section titled “Measures”SUM GL Amt
Section titled “SUM GL Amt”SUM GL Amt :=SUM ( 'General_Ledger'[Amount] )GL Amt (Correct Signs)
Section titled “GL Amt (Correct Signs)”GL Amt (Correct Signs) :=SUMX ( Accounts, [SUM GL Amt] * Accounts[Report Sign] )Actual Amt
Section titled “Actual Amt”Actual Amt :=CALCULATE ( [GL Amt (Correct Signs)], Scenarios[ScenarioName] = "Actual" )Rev Act
Section titled “Rev Act”Rev Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Revenue" )CoS Act
Section titled “CoS Act”CoS Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Cost of Sales" )GP Act
Section titled “GP Act”GP Act :=[Rev Act] + [CoS Act]OpEx Act
Section titled “OpEx Act”OpEx Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Operating Expenses" )OI Act
Section titled “OI Act”OI Act :=[GP Act] + [OpEx Act]OI&E Act
Section titled “OI&E Act”OI&E Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Other Income & Expense" )D&A Act
Section titled “D&A Act”D&A Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Depreciation & Amortization" )II&E Act
Section titled “II&E Act”II&E Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Interest Income/Expense" )Taxes Act
Section titled “Taxes Act”Taxes Act :=CALCULATE ( [Actual Amt], Headers[Header] = "Taxes" )NI Act
Section titled “NI Act”NI Act :=[OI Act] + [OI&E Act] + [D&A Act] + [II&E Act] + [Taxes Act]IS Subtotal Act
Section titled “IS Subtotal Act”IS Subtotal Act :=IF ( COUNTROWS ( VALUES ( Headers[Header] ) ) = 1, SWITCH ( VALUES ( Headers[Header ID] ), 1, [Rev Act], 2, [CoS Act], 3, [GP Act], 4, [OpEx Act], 5, [OI Act], 6, [OI&E Act], 7, [D&A Act], 8, [II&E Act], 9, [Taxes Act], 10, [NI Act], BLANK () ), BLANK ())Actual Total
Section titled “Actual Total”Actual Total :=IF ( MAX ( Headers[Summary] ) = 1 && ( MAX ( Headers[Show Detail] ) = 1 || COUNTROWS ( VALUES ( Subheader[Subheader] ) ) > 1 ), [IS Subtotal Act], [Actual Amt])Budget Amt
Section titled “Budget Amt”Budget Amt :=CALCULATE ( [GL Amt (Correct Signs)], Scenarios[ScenarioName] = "Budget" )Rev Bud
Section titled “Rev Bud”Rev Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Revenue" )CoS Bud
Section titled “CoS Bud”CoS Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Cost of Sales" )GP Bud
Section titled “GP Bud”GP Bud :=[Rev Bud] + [CoS Bud]OpEx Bud
Section titled “OpEx Bud”OpEx Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Operating Expenses" )OI Bud
Section titled “OI Bud”OI Bud :=[GP Bud] + [OpEx Bud]OI&E Bud
Section titled “OI&E Bud”OI&E Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Other Income & Expense" )D&A Bud
Section titled “D&A Bud”D&A Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Depreciation & Amortization" )II&E Bud
Section titled “II&E Bud”II&E Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Interest Income/Expense" )Taxes Bud
Section titled “Taxes Bud”Taxes Bud :=CALCULATE ( [Budget Amt], Headers[Header] = "Taxes" )NI Bud
Section titled “NI Bud”NI Bud :=[OI Bud] + [OI&E Bud] + [D&A Bud] + [II&E Bud] + [Taxes Bud]IS Subtotal Bud
Section titled “IS Subtotal Bud”IS Subtotal Bud :=IF ( COUNTROWS ( VALUES ( Headers[Header] ) ) = 1, SWITCH ( VALUES ( Headers[Header ID] ), 1, [Rev Bud], 2, [CoS Bud], 3, [GP Bud], 4, [OpEx Bud], 5, [OI Bud], 6, [OI&E Bud], 7, [D&A Bud], 8, [II&E Bud], 9, [Taxes Bud], 10, [NI Bud], BLANK () ), BLANK ())Budget Total
Section titled “Budget Total”Budget Total :=IF ( MAX ( Headers[Summary] ) = 1 && ( MAX ( Headers[Show Detail] ) = 1 || COUNTROWS ( VALUES ( Subheader[Subheader] ) ) > 1 ), [IS Subtotal Bud], [Budget Amt])Variance $
Section titled “Variance $”Variance $ := [Actual Total] - [Budget Total],Variance %
Section titled “Variance %”Variance % := DIVIDE ( [Variance $], [Budget Total] )