financial models and scenario calculations

25
Mastering Power BI Workshop Lab 10 © Copyright 2018, Intelligent Business Page 1 Intelligentbiz.net Lab Financial Models and Scenario Calculations This workshop is an adaption of Lab 10 from the three-day Mastering Power BI course available from Intelligent Business and CSG Pro. In this adaption of the lab, you will use an existing Power BI Desktop project that contains data previously extracted from a SQL Server database. Follow the instructions below titled “Not Connected to SQL Server”. You will need a Power BI Desktop update as of July 2018 to open the provided Power BI report files. To update, navigate to PowerBI.com and select Power BI Desktop from the Products menu. This lab will demonstrate how to create a multi-level chart of accounts to analyze an accounting ledger containing debit and credit accounts. This lab is intended to be challenging and realistic. In preparation for Module 11, “Advanced Calculations with DAX”, you will be adding several complex calculations just by copying and pasting provided code. This can be tedious work and requires some attention to detail. Please follow these steps explicitly and be mindful of the time allotted to this lab. Completed copies of the lab PBIX file are provided in three different stages of the lab. Use these files for reference or as a midway starting point if you get stuck or run out of time. You will apply conditional calculations to roll-up account totals and correctly balance the financial ledger. Advanced DAX expressions will be used to apply unary operators and iterator functions to sum up account totals using row-level expressions. Data for this solution is stored in a SQL Server dimensional database but the lab can be performed with or without connecting to SQL Server. Lab Setup To complete this lab, you will need the accompanying scripts file: Account Hierarchy Scripts.txt The data for this lab is stored in a centrally managed SQL Server data warehouse. There are two options for this lab: Connected to SQL Server: If you have access to an instance of SQL Server prepared for this class, your instructor will provide the necessary connection information to connect to the SQL Server instance in Azure SQL Database or an on-premises server. Not Connected to SQL Server: Copy the Lab 10-1-Accounts Hierarchy (data import completed).pbix file from the Lab Files- Completed folder to the Lab Files-Working Folder and rename the file to: Lab 10 - Account Hierarchy.pbix. Read through the first section to familiarize yourself with the process and then skip ahead to the second section titled: Create the Data Model. Credit Thanks to Marco Russo for designing the initial data model and for providing revisions during lab development. Portions of this lab were adapted from the Analysis Services projects provided in Tabular Modeling in Microsoft SQL Server Analysis Services (2nd Edition), Microsoft Press written by Marco Russo and Alberto Ferrari.

Upload: others

Post on 14-Apr-2022

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 1 Intelligentbiz.net

Lab Financial Models and Scenario Calculations

This workshop is an adaption of Lab 10 from the three-day Mastering Power BI course available

from Intelligent Business and CSG Pro. In this adaption of the lab, you will use an existing Power

BI Desktop project that contains data previously extracted from a SQL Server database. Follow the

instructions below titled “Not Connected to SQL Server”. You will need a Power BI Desktop update

as of July 2018 to open the provided Power BI report files. To update, navigate to PowerBI.com

and select Power BI Desktop from the Products menu.

This lab will demonstrate how to create a multi-level chart of accounts to analyze an accounting

ledger containing debit and credit accounts. This lab is intended to be challenging and realistic. In

preparation for Module 11, “Advanced Calculations with DAX”, you will be adding several complex

calculations just by copying and pasting provided code. This can be tedious work and requires some

attention to detail. Please follow these steps explicitly and be mindful of the time allotted to this

lab. Completed copies of the lab PBIX file are provided in three different stages of the lab. Use

these files for reference or as a midway starting point if you get stuck or run out of time.

You will apply conditional calculations to roll-up account totals and correctly balance the financial

ledger. Advanced DAX expressions will be used to apply unary operators and iterator functions to

sum up account totals using row-level expressions. Data for this solution is stored in a SQL Server

dimensional database but the lab can be performed with or without connecting to SQL Server.

Lab Setup To complete this lab, you will need the accompanying scripts file: Account Hierarchy Scripts.txt

The data for this lab is stored in a centrally managed SQL Server data warehouse. There are two

options for this lab:

Connected to SQL Server:

If you have access to an instance of SQL Server prepared for this class, your instructor will provide

the necessary connection information to connect to the SQL Server instance in Azure SQL Database

or an on-premises server.

Not Connected to SQL Server:

Copy the Lab 10-1-Accounts Hierarchy (data import completed).pbix file from the Lab Files-

Completed folder to the Lab Files-Working Folder and rename the file to: Lab 10 - Account

Hierarchy.pbix. Read through the first section to familiarize yourself with the process and then skip

ahead to the second section titled: Create the Data Model.

Credit Thanks to Marco Russo for designing the initial data model and for providing revisions during lab

development. Portions of this lab were adapted from the Analysis Services projects provided in

Tabular Modeling in Microsoft SQL Server Analysis Services (2nd Edition), Microsoft Press written by

Marco Russo and Alberto Ferrari.

Page 2: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 2 Intelligentbiz.net

Import Account Dimension and Fact Tables Import tables from the data warehouse stored in SQL Server.

1. If Power BI Desktop is open, save your work and close the application.

2. Open Power BI Desktop.

3. On the opening splash screen, click Get Data.

4. On the Get Data dialog, select SQL Server database and click Connect.

5. Enter the name of the SQL Server database server provided by your instructor.

6. Enter ContosoDW for the database name and click OK.

7. On the Navigator dialog, check each of the following tables:

Analytics.Account Analytics.Date Analytics.Product Category Analytics.Scenario Analytics.Strategy Plan

8. Click the Edit button to create queries for each table and open the Query Editor.

Page 3: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 3 Intelligentbiz.net

9. From the Queries list on the left side, select each table one at a time. For each

table, in the Name property box on the right side, select and delete the

“Analytics “ prefix (including the space).

10. Press Enter to accept the name change.

11. After changing all the query names, click Close & Apply to load tables into the

data model.

Page 4: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 4 Intelligentbiz.net

Create the Data Model If you completed the previous section, “Import Account Dimension and Fact Tables”,

simply continue with these instructions. If you don’t have connectivity to SQL

Server and the ContosoDW database and have followed the directions in the “Lab

Setup” section to skip the “Import Account Dimension and Fact Tables” section,

open the Lab 10 - Account Hierarchy.pbix file in Power BI Desktop.

1. In the main Power BI Desktop window click the Relationships icon on the left

side to switch to the model diagram view.

2. Note that the Date table doesn’t have a relationship to the Strategy Plan table.

This is because the key column names don’t match.

3. Click and drag the DateKey column from the Strategy Plan table to the Date

column in the Date table. This creates a relationship between these two tables.

4. If there is no existing relationship to the Scenario table, click and drag the

ScenarioKey column from the Strategy Plan table to the ScenarioKey column in

the Scenario table.

5. If there is no existing relationship to the Account table, click and drag the

AccountKey column from the Strategy Plan table to the AccountKey column in

the Account table.

6. If there is no existing relationship to the Product Category table, click and drag

the ProductCategoryKey column from the Strategy Plan table to the

ProductCategoryKey column in the Product Category table.

7. Use the Data icon on the left side to switch to data grid view.

8. Select the Date table from the Fields list on the right side.

Each numeric column in this table has been automatically set to summarize

values using the Sum aggregate. This is apparent when you see the Sigma icon

next to the field name.

Page 5: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 5 Intelligentbiz.net

Most of these columns will be used only for sorting other columns so there is no

need to change them not to summarize like you would if they were to remain

visible. Each of these columns will be hidden.

9. For each field in the Field to be sorted column, use the Sort by Column drop-

down list to verify the field in the Sort by this field column.

10. In turn, select each field in the Sort by this field column, click the ellipsis (…) on

the right side of the item in the Fields list and then select Hide in Report View.

Field to be sorted Sort by this field

Calendar Year Calendar Year Number

Calendar Year Month Calendar Year Month Number

Calendar Year Quarter Calendar Year Quarter Number

Day of Week Day of Week Number

Fiscal Month Fiscal Month Number

Fiscal Quarter Fiscal Quarter Number

Fiscal Year Fiscal Year Number

Fiscal Year Quarter Fiscal Year Quarter Number

Month Month Number

11. Use the ellipsis menu to hide the Datekey field.

12. For the remaining fields in the Date table that are not hidden and have a Sigma

icon next to them, select that field in the Fields list and use the Default

Summarization drop-down list (in the Properties group near the center of the

Modeling ribbon) to choose Don’t Summarize.

13. Verify the Data type for the Is Holiday field has been changed from Whole

Number to True/False. You will be prompted to confirm this change.

Page 6: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 6 Intelligentbiz.net

Create a Calendar hierarchy 1. From the Fields list, click the ellipsis on the right side of the Calendar Year field

item and then choose New Hierarchy.

2. Rename the newly created hierarchy to Calendar.

3. Click the ellipsis on the Calendar Year Quarter field, select Add to Hierarchy and

select the Calendar hierarchy.

4. Click the ellipsis on the Month field, select Add to Hierarchy and select the

Calendar hierarchy.

5. Click the ellipsis on the Date field, select Add to Hierarchy and select the

Calendar hierarchy.

6. Starting with the Fiscal Year field, create a new hierarchy named Fiscal.

7. In turn, add the Fiscal Quarter, Fiscal Month and Date fields to the Fiscal

hierarchy.

8. Expand both new hierarchies in the Fields list.

9. Rename the hierarchies and levels as follows:

Hierarchy Level

Calendar Year

Calendar Quarter

Calendar Month

Calendar Date

Fiscal Fiscal Year

Fiscal Fiscal Quarter

Fiscal Fiscal Month

Fiscal Date

Page 7: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 7 Intelligentbiz.net

Refer to the following image to verify this step:

Completed Lab File A version of the project file, completed to this stage in the lab, is provided for you to check your

work or move ahead to this point in the exercise. To skip ahead, copy the Lab 10-2 - Accounts

Hierarchy (data model completed).pbix file in the Lab Files-Completed folder to the folder

named Lab Files-Working Folder, and use that as a starting point for the next section.

Page 8: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 8 Intelligentbiz.net

Add Calculated Columns You will create 16 calculated columns in this section. The DAX code for some of

these calculations is fairly complex but all of the code is provided for you to copy

and paste. As you follow these directions, copy each calculation separately and

paste it into the Formula bar one-at-a-time. After pasting the code, if the

calculation is not applied when you press the Enter key, it will be when you click the

Calculated Column button to create the next column. Click the floppy disk icon in

the toolbar to save your work after each step.

1. Open the Account Hierarchy Scripts.txt file.

2. Select the following text under the //Columns heading (it is only one line) and

copy it to the clipboard:

HierarchyPath = PATH ( Account[AccountKey],

Account[ParentAccountKey] )

3. In Power BI Desktop, use the Data icon on the left to make sure you are in Data

grid view.

4. Select the Account table from the Fields list on the right.

5. Use the Data icon on the left to view the table in data grid view.

6. On the Modeling ribbon, click the New Column button.

7. Paste the text from the clipboard. The default Column = will be overwritten in

the formula bar. Make sure the formula bar has focus and then press Enter.

A new column is created with the name HierarchyPath in the heading.

8. Repeat the steps to add the following calculated column with DAX code copied

from the script file. This one is also a single line of code in the script file.

• HierarchyDepth

Look at the values in the two new columns. The PATH function traverses the

parent-child hierarchy and creates a pipe-delimited list of key values in the

hierarchy chain. The PATHLENGTH function uses this path to calculate and

return the level depth of a member within the hierarchy.

9. Repeat the steps to add each of the following additional calculated columns.

Each is multiple lines Carefully select the entire calculation formula from the

script file (including the last closing parenthesis but don’t select the next

formula). These seven columns will be used to construct the levels of a

hierarchy in the data model. As you create each of these calculated columns,

note the lookup values for these seven levels for the Chart of Accounts

hierarchy:

• AccountLevel1

• AccountLevel2

• AccountLevel3

• AccountLevel4

• AccountLevel5

• AccountLevel6

• AccountLevel7

Page 9: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 9 Intelligentbiz.net

10. Copy and paste the script to create the next column:

• Multiplier

The Multiplier column converts the Unary operator (“+”, “-“ or blank value) to

an integer that is used to transform credit and debit values into positive or

negative accumulated values. The resulting values can then be summed with

other sibling values at the same level. The next challenge is to roll-up the

subtotal values for each account in the hierarchy. To do this, you will create

calculated columns in reverse order because each level calculation depends on

the +/- sign of the previous level calculation.

11. Copy and paste the script, one at a time, to create the next seven columns:

• SignAtLevel7

• SignAtLevel6

• SignAtLevel5

• SignAtLevel4

• SignAtLevel3

• SignAtLevel2

• SignAtLevel1

The Account table calculated columns are now complete and you have all the

necessary information to build the Chart of Accounts hierarchy and to add

dependent measures.

Create Chart of Accounts hierarchy 1. In the Fields list for the Account table, click the ellipsis on the right side of the

AccountLevel1 field and select New Hierarchy. The selected field is added as

the first level of the new hierarchy. You will rename this.

2. Rename the new “AccountLevel1 Hierarchy” hierarchy: Chart of Accounts.

3. Click the ellipsis for the AccountLevel2 field and add it to the Chart of Accounts

hierarchy.

4. Repeat the same step for the AccountLevel3, AccountLevel4, AccountLevel5,

AccountLevel6 and AccountLevel7 fields.

5. Rename each level as: Level 1, Level 2, Level 3, Level 4, Level 5, Level 6 and

Level 7.

Completed Lab File A version of the project file, completed to this stage in the lab, is provided for you to check your

work or move ahead to this point in the exercise. To skip ahead, copy the Accounts Hierarchy

Lab 10-3 (calculated columns completed).pbix file in the Lab Files-Completed folder to the

folder named Lab Files-Working Folder, and use that as a starting point for the next section.

Page 10: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 10 Intelligentbiz.net

Add Measures The DAX code for the measures you need to create is provided in the same scripts

file as the calculated columns. Since the measure calculations are shorter, try to

write at least some of these by hand. If you have any trouble, you can use the script

file for reference or copy and paste as a last resort. After writing the formula, make

sure to press the Enter key to commit the new measure. Click the Save button on

the toolbar to save your work often.

1. With the Account table selected in the Fields list, click the New Measure button

on the Modeling ribbon.

2. Add the Current Hierarchy Depth measure to the Account table by copying and

pasting following script in the formula bar associated with the New Measure

and pressing Enter.

Current Hierarchy Depth =

ISFILTERED ( Account[AccountLevel1] )

+ ISFILTERED ( Account[AccountLevel2] )

+ ISFILTERED ( Account[AccountLevel3] )

+ ISFILTERED ( Account[AccountLevel4] )

+ ISFILTERED ( Account[AccountLevel5] )

+ ISFILTERED ( Account[AccountLevel6] )

+ ISFILTERED ( Account[AccountLevel7] )

3. Enter each of these as separate measures: Max Depth and Min Depth.

Max Depth = MAX ( Account[HierarchyDepth] )

Min Depth = MIN ( Account[HierarchyDepth] )

4. Finally, enter the Account Operator measure:

Account Operator =

VAR CurrentLevel = [Current Hierarchy Depth]

RETURN

IF (

CurrentLevel = [Min Depth],

CALCULATE (

IF (

HASONEVALUE ( Account[Operator] ),

VAR Operator =

VALUES ( Account[Operator] )

RETURN

IF ( Operator = "-", "–", Operator )

),

Account[HierarchyDepth] = CurrentLevel

)

)

Page 11: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 11 Intelligentbiz.net

5. Save your work and look over the code for each measure to ensure that there

are no errors indicated with a red squiggly underline in the expanded Formula

bar.

Hide the Account fields and measures

All of the measures you added to the Account table are used to perform calculations

that support internal functionality, and they won’t be exposed directly to users.

After hiding these measures, you will reference them in a few simple measures you

will add to the Strategy Plan table.

Warning: After hiding these measures, users of this model will never know or

appreciate how much work was involved to create this calculation logic. Thus is

the nature of complex data model design.

1. For each field and measure in the Account table, use the ellipsis menu to hide

that object. The only object in this table that should be left visible is the Chart

of Accounts hierarchy and it’s levels.

2. Verify that all objects in the Account table are hidden and that the Chart of

Accounts hierarchy and all the levels are visible.

Page 12: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 12 Intelligentbiz.net

Add the Strategy Plan table measures The Strategy Plan table includes the Amount field, which is the plan amount by month

for each account, scenario and product category. For our purposes, we can ignore the

scenario and product category for testing purposes.

The Plan Amount Current measure will apply the correct account-specific calculation for

a given Account level. Like the previous measures, the script is provided but you

encouraged to write this measure by hand using the tools in the formula bar.

1. Select the Strategy Plan table and click the New Measure button in the

Modeling ribbon.

2. Expand the Formula Bar and enter the following text:

Sum of Amount = SUM('Strategy Plan'[Amount])

3. Use the ellipsis menu for the selected measure item on the Fields list to hide the

measure.

4. Add the Amount Total measure, which orchestrates all of the calculation logic

you have painstakingly created and hidden from view.

Page 13: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 13 Intelligentbiz.net

This measure conditionally calculates the Amount value for the current level of

the Chart of Accounts hierarchy. Once the level has been determined for each

row, the level-specific multiplier (1 or -1) is applied for the sum of the Amount

field. After that calculation is performed on each row, the SUMX iterator

function sums up the resulting values into a single value.

As you can see, this formula has a redundant pattern. To save time and

keystrokes, you can copy and paste the SUMX expression but carefully check

your work to make sure you apply the necessary adjustments to column

references and parameter values. If you get stuck or if you are short on time,

you can copy and paste the code from the script file.

Amount Total =

IF (

[Min Depth] >= [Current Hierarchy Depth],

SWITCH (

[Current Hierarchy Depth],

1, SUMX (

VALUES ( Account[SignAtLevel1] ),

Account[SignAtLevel1] * [Sum of Amount]

),

2, SUMX (

VALUES ( Account[SignAtLevel2] ),

Account[SignAtLevel2] * [Sum of Amount]

),

3, SUMX (

VALUES ( Account[SignAtLevel3] ),

Account[SignAtLevel3] * [Sum of Amount]

),

4, SUMX (

VALUES ( Account[SignAtLevel4] ),

Account[SignAtLevel4] * [Sum of Amount]

),

5, SUMX (

VALUES ( Account[SignAtLevel5] ),

Account[SignAtLevel5] * [Sum of Amount]

),

6, SUMX (

VALUES ( Account[SignAtLevel6] ),

Account[SignAtLevel6] * [Sum of Amount]

),

7, SUMX (

VALUES ( Account[SignAtLevel7] ),

Account[SignAtLevel7] * [Sum of Amount]

)

)

)

5. Verify the format for the Amount Total measure is Currency general.

Page 14: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 14 Intelligentbiz.net

6. Hide every field and measure in the Strategy Plan table except for the Amount

Total measure.

Create a Report Page to Test the Solution

1. To test the solution thus far, use the Chart icon on the left to switch to the

Report canvas.

2. Expand the Account table and then drag and drop the Chart of Accounts

hierarch to the upper-left area of the report canvas.

A table is created showing all levels of the hierarchy.

3. Resize the table to show all the columns.

4. With the table selected, click the Matrix preview icon on the Visualizations

panel. This will collapse the hierarchy to show only the top-level account,

“Profit and Loss after tax”.

5. Expand the Strategy Plan table and then drag and drop the Amount Total

measure to the matrix visual.

The Amount Total is displayed for the top-level account.

6. The third icon from the left, in the heading of the matrix visual is used to drill-

down through the hierarchy. Click this icon six times to expand the Chart of

Accounts to the lowest level.

The account hierarchy and roll-up calculation is working but it is not quite

accurate yet. You are seeing three different account scenarios (Actual, Budget

and Forecast) added together.

7. Expand the Scenario table and then drag and drop the Scenario field to a blank

area of the report canvas.

8. Use the Slicer icon in the Visualizations panel to change the table to a slicer.

9. Check a box to see only Actual, Budget or Forecast values.

Page 15: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 15 Intelligentbiz.net

Page 16: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 16 Intelligentbiz.net

Create Actual, Budget and Forecast measures

1. Add the following measures to the Strategy Plan table. After creating each

measure, format it as: Currency general.

Actual Amount = CALCULATE( [Amount Total],

'Scenario'[Scenario] = "Actual" )

Budget Amount = CALCULATE( [Amount Total],

'Scenario'[Scenario] = "Budget" )

Forecast Amount = CALCULATE( [Amount Total],

'Scenario'[Scenario] = "Forecast" )

2. On the Report page with the Matrix Visual selected, remove the Amount

Total measure from the Values field well for the matrix visual

3. Add all three new measures to the Values field well.

You can continue to analyze this data on your own. The finance scenarios can be

sliced and grouped by Year, Quarter and Month; and by Product Category. Create

additional report pages to analyze trends and comparisons using charts, KPIs and

other visuals.

Clean-up the Data Model

Page 17: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 17 Intelligentbiz.net

Making the effort to tidy-up your data models will significantly improve the user

experience and provide users with a comfortable, uncomplicated and clutter-free

report navigation experience.

1. Expand all table in the Fields list.

2. Hide every object that users don’t need to see. This should include every

“…Key” column used in table relationships.

The following image shows all the fields, calculated columns, measures,

hierarchy and levels that should remain visible. Hide every other object that

doesn’t appear in this image:

3. Save your work and close the Account Hierarchy Lab 10.pbix file. You will

use this data model to visualize financial data in module 12.

Completed Lab File A version of the project file, completed to this stage in the lab, is provided for you to check your

work or move ahead to this point in the exercise. To skip ahead, copy the Accounts Hierarchy

Page 18: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 18 Intelligentbiz.net

Lab 10-4 (measures completed) file in the Lab Files-Completed folder to the folder named Lab

Files-Working Folder.

Page 19: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 19 Intelligentbiz.net

Create Financial Scorecard Let’s back-up and work through the presentation of the chart of accounts with more focus. This exercise

will give you an opportunity to better understand the behavior or the matrix visual to present calculated

account balances across the accounts ragged hierarchy with different financial scenarios.

1. At the bottom of the report designer, click the “+” button to add a new

report page.

2. From the Fields list on the right, expand the Account table and drag the

Chart of Accounts hierarchy to the canvas.

A table visual is created with columns for all seven levels.

3. Expand the Strategy Plan table and drag the Amount Total measure to the

new table visual.

The Amount Total column is added to the table. However, the only items

shown are accounts that exist at the lowest level.

In a table, you must show rows without values to see each level in the

hierarchy.

4. On the right side of the designer, in the Values field well, click the down

arrow “caret” to show the menu.

5. Click to select the item, Show items with no data.

Page 20: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 20 Intelligentbiz.net

The table shows all rows but only values for the “leaf level” items.

6. To switch the Table to a Matrix visual, select the table visual in the report

canvas and then click the Matrix icon in the Visualizations panel.

The matrix now shows only the highest-level account in the ledger, “Profit

and loss after tax”.

7. Expand each level by clicking the “Expand All” drill-down button. It is right-

most button on the left side of the heading in the Matrix visual (refer to the

following figure).

Page 21: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 21 Intelligentbiz.net

8. Click the “Expand All” drill-down icon seven times or until the icon is grayed-

out.

Note that several empty rows are visible. This is due to the ragged

hierarchy having blank values at lower levels within the table. Showing

items with no data allowed us to see the hierarchy level in the table but this

setting doesn’t have the same effect in the matrix.

9. Like before, with the matrix selected, use the down arrow caret for the

Chart of Accounts hierarchy in the Rows field well.

10. Click to deselect the “Show items with no data” item on the menu.

Page 22: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 22 Intelligentbiz.net

With the hierarchy expanded, the matrix is correctly visualizing values and

aggregate totals. However, the Amount Total includes all three scenarios

(Actual, Budget and Forecast).

11. Make sure that the matrix visual is still selected in the report canvas.

12. Expand the Scenario table in the Fields list, to the right of the designer.

13. Drag the Scenario field from the Fields list to the Columns field well for the

matrix visual.

Separate columns are displayed for each of the scenarios; Actual, Budget

and Forecast. These values should now be accurate, reflecting the account

balances of each account for all available records (which includes a period of

three years). The Total column, however, is not useful because you cannot

add Actuals to Budget and Forecast values to produce a meaningful result.

Page 23: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 23 Intelligentbiz.net

Remove the Total column:

14. Make sure that the matrix visual is selected.

15. Use the paint roller icon to show the properties for the matrix and expand

the Subtotals section.

16. Use the switch control to disable Column subtotals.

With the Total column removed, the account total displayed across each

scenario are now accurate and meaningful.

Page 24: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 24 Intelligentbiz.net

Enhance the Scorecard Report The rest of the report design is up to you. With the essential design features in-place, you can enhance

the report to add slivers and additional visuals that show each scenario amount measure as a separate

card. You can also add a KPI to show the actual compared to the budget amount. If you need help,

open the completed report file, Lab 10-5-Accounts Hierarchy (scorecard completed).pbix, in a separate

Power BI Desktop window and compare your work with the example provided.

Now that you have a working balance sheet, make the following enhancements in

the report to build-out the scorecard:

1. Add a slicer for the Fiscal Year.

2. In the General section of the slicer properties, change the Orientation to

Horizontal.

3. Add Card visuals for these measures:

• Actual Amount

• Budget Amount

• Forecast Amount

4. Add a KPI visual to show the Actual Amount compared to the Budget

Amount for the last month of the selected fiscal year. The field assignments

for the KPI visual are shown below. Drag the following fields and measures

from the Field list to these field wells:

5. Use the horizontal slicer to select a fiscal year. FY 2007, 2008, 2009 or 2010

are valid selections in this data set.

The report should respond and show results similar to the following:

Page 25: Financial Models and Scenario Calculations

Mastering Power BI Workshop Lab 10

© Copyright 2018, Intelligent Business Page 25 Intelligentbiz.net

With this foundational data model completed, many enhancements are possible. Use this report file as

a starting point to use additional visuals and slicers to extend your solution. For example, on a new

page, create a trend report to show actual and budget balances over time and sliced by different time

periods and product categories.