top of page

Income (P&L) Statement in PowerBI

  • Oct 19, 2022
  • 4 min read

ree

Photo by Ray Reyes on Unsplash


One of the three statements used in corporate accounting and finance is the income statement. The statement shows the business’s revenue, gross profit, selling and administrative costs, other expenses and income, taxes paid, and net gain over a certain period.

If I were an accountant, I wouldn’t want to create an income statement every month, quarter or year.

How, then, can I make my life and work easy?


ree

PowerBI is the solution. Create a report once and let it auto-refresh as you have more data

ree

Download sample data here

The following tables are needed for the income statement report and loaded into PowerBI.


ree


The Company expenses data looks somewhat like this, which is unsuitable for our data model. Hence the need to unpivot.


ree


After unpivoting, the data is now suitable for the data model.


ree

The final model looks like this.


ree

The format I usually stick to is dimension tables at the top with fact tables underneath it, while supporting tables are at the bottom. DAX measures tables are always by the right. That way, I have a clear overview of all tables in my model.

An income statement speaks to the organization’s revenue and expenses. The tricky part is merging the sales data and company expenses data. Put in mind that both data have different granularity, i.e. the sales data is on a day-to-day basis while the expense data is monthly.

How, then, do we ensure they have the same granularity?


ree

Create a supporting table from the Sales data


ree

Photo by Ameen Fahmy on Unsplash


To do this, let’s first calculate our total revenue using the Sales table.


ree

Next, we create a supporting table from the sales table whose granularity is a monthly interval. To do this, we use the DAX seen below to create a new table.


ree

The SUMMARIZE function is similar to SQL Group BY. It groups the specified table based on the columns in that table or related tables. In our case, we are grouping the sales table by the sales channel and the Month & Year columns on the calendar table.

Now we have a sales table with the same granularity as the company expense table.


ree

Then we combine both the Sales data and the company expenses data into what will be our income statement data using the UNION function.


ree

The Union function returns a table that contains all rows from both tables. The caveat with this function includes;

  1. The two tables must have the same number of columns

  2. Columns are combined by position in their respective tables, irrespective of the column content. Hence the need for another summarize function to ensure the data merge appropriately.

  3. The column names in the return table will match the names in the first specified table, i.e. the Company Expenses column names will be inherited.

The result is seen below.


ree

The type and type index columns were added using an if statement.


ree

ree

The reason why I added these columns would be seen later on.

If we look at the income statement template, we have the following items;

  1. Total Revenue

  2. Total COGS

  3. Total Gross Profit

  4. Gross Profit %

  5. Total Other Expenses

  6. Total Net Profit

  7. Net Profit %

Since they are not included in our data, we would have to write dax measures to calculate them individually.


ree

  1. Calculate Total Revenue


ree

2. Calculate Total COGS


ree

In accounting, expenses are recorded with negative values, hence a need to multiply the calculated function output by -1.


3. Calculate the Total Gross Profit


ree

4. Gross Profit %


ree

5. Total Other Expenses


ree

6. Total Net Profit


ree

The addition is done here because the COGS and Other Expenses will have negative values.

7. Net Profit %


ree

Now we have created all the individual totals. We need to reference all these measures in a single DAX.

We are almost there


ree

All that is left is to calculate the actual values. The DAX below will help us achieve this.


ree

This will return the row item values on the income statement template.


ree

The recipe to prepare our income statement is fully ready.


ree

Let’s create our income statement



You know the sweet thing with PowerBI


ree

Photo by Blake Cheek on Unsplash


You can run comparisons. This year vs last year, Q2 vs Q1.

Let’s take a quick look at the DAX that lets us achieve this year vs last year.

  1. Total Revenue LY


ree

2. Total COGS LY


ree

3. Total Gross Profit LY


ree

4. Gross Profit % LY


ree

5. Total Other Expenses LY


ree

6. Total Net Profit LY


ree

7. Net Profit % LY


ree

8. Actuals LY


ree

What is the difference between this year’s and last year’s performance?


ree

I know what you are thinking, so why not use this?


ree

Sadly you will get the error below.


ree

This is a result of the format function used in our DAX measure.

What is the percentage of this difference?


ree

All that is left is just for you to add these new measures to your table, and you are done.


ree

View the completed report here.

Next year, next quarter, or next month, you don’t have to spend minutes or hours creating an income statement. All you need to do is ensure the data source is updated. Your finance manager does not need to wait days to get the report, and the award is yours.

Congratulations on winning the employee of the month/year award.


ree


Comments


bottom of page