Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Brysonds
Helper III
Helper III

[Need Help] Adding measures to Matrix for Profit and Loss Report

Hi Everyone,

 

I am curious if it's possible to build a traditional P&L report in Power BI. I know that if I start with a table that is already in P&L layout, this works fine (see example 1). However, the data is not in a P&L layout already, it's just a flat file. I can easily add some dimnensionality to the flat file using conditional columns. For example, if the GL account is in this 400000 - 499999 range, then it's part of Sales, or if it's in the 500000 - 599999 then it's Cost of Goods sold. The challenge is showing the calculations (Gross Profit, Operating Profit, etc.) in the same Matrix view (see example 2). Has anyone been able to solve this? 

 

Example 1

If the data is stored in a P&L format, everything is fine. The problem is that our data is not stored like this...

 

Data Table

Data Table.jpg

 

Report Output

PBI Report Output.JPG

 

 

Example 2

In real life, calculations like Gross Profit are not stored in the database. I create the calculations in Power BI using calculated measures

 

Gross Profit Measure

Gross Profit = CALCULATE(CALCULATE(SUM('Europe Finance Data'[Amount]), 'Europe Finance Data'[P&L Category]="Sales")+(CALCULATE(SUM('Europe Finance Data'[Amount]), 'Europe Finance Data'[P&L Category]="Cost of Goods Sold")))

 

I would like to include these calculations in the Matrix report as subtotals for the different P&L categories, but I don't see a way to do this in Power BI.

Want to add GP.jpg

 

 

 

 

 

 

 

 

3 REPLIES 3
VP
MVP

You will not be able to add Measure to Row or column section.

 

In order to solve you problem, you can perform action in Power Query or Data model

 

For reference, There is excellent report prepared by partner (SENSDAT - Power BI Profit and Loss & Balance Sheet Solution):- SENSDAT - Power BI Profit and Loss & Balance Sheet Solution

Brysonds
Helper III
Helper III

Hi Everyone,

 

I am curious if it's possible to build a traditional P&L report in Power BI. I know that if I start with a table that is already in P&L layout, this works fine (see example 1). However, the data is not in a P&L layout already, it's just a flat file. I can easily add some dimnensionality to the flat file using conditional columns. For example, if the GL account is in this 400000 - 499999 range, then it's part of Sales, or if it's in the 500000 - 599999 then it's Cost of Goods sold. The challenge is showing the calculations (Gross Profit, Operating Profit, etc.) in the same Matrix view (see example 2). Has anyone been able to solve this? 

 

Example 1

If the data is stored in a P&L format, everything is fine. The problem is that our data is not stored like this...

 

Data Table

Data Table.jpg

 

Report Output

PBI Report Output.JPG

 

 

Example 2

In real life, calculations like Gross Profit are not stored in the database. I create the calculations in Power BI using calculated measures

 

Gross Profit Measure

Gross Profit = CALCULATE(CALCULATE(SUM('Europe Finance Data'[Amount]), 'Europe Finance Data'[P&L Category]="Sales")+(CALCULATE(SUM('Europe Finance Data'[Amount]), 'Europe Finance Data'[P&L Category]="Cost of Goods Sold")))

 

I would like to include these calculations in the Matrix report as subtotals for the different P&L categories, but I don't see a way to do this in Power BI.

Want to add GP.jpg

 

 

 

 

 

 

 

 

There's another approach to it as well: http://www.thebiccountant.com/2017/04/24/kpis-in-easy-profit-and-loss-for-powerbi/

It is more flexible and doesn't require to write all the different measures manually, but needs a bit more input with regards to model building / transforming your data.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors