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
dannywallis1994
Frequent Visitor

Building a P&L matrix with calculated lines (data source is Dynamics 365 business central)

Hi all, 

Wondering if someone can help. 

I have linked my PBI file to Dynamics 365 business central and pulled through both the genral ledger and chart of accounts tables and created a relationship between the two which is working well. I also have a calandar table which has a relationship with the genral ledger. 

 

However, I would like to calculate some additional P&L lines which are not in my genral ledger e.g EBITDA. 

 

What is the best way to do this? Do i need to created a calculated table? I belive it is best that I only have 1 value field as I am looking to add a switch in to compare to prior year, quarter etc. 

 

Thanks in advance for your help. 

1 ACCEPTED SOLUTION

@dannywallis1994,

 

Try this solution using the native matrix. It requires more setup, however, and the result is a matrix that may not meet the formatting requirements. I recommend trying the Profitbase Financial Reporting Matrix. Finance users love it, as it offers many advantages including the ability to create subtotals, add blank rows, apply specific formatting, etc.

 

Add EBITDA to the Lookup table, along with an Index column for sorting Category:

 

DataInsights_0-1651155418772.png

 

Data model:

 

DataInsights_1-1651155439735.png

 

In the GL Entries table, create a calculated column to flip the sign. You can also do this in Power Query.

 

Adjusted Amount = 
SWITCH (
    TRUE,
    'GL Entries'[GL Code] >= 1001
        && 'GL Entries'[GL Code] < 2000, 'GL Entries'[Amount],
    'GL Entries'[GL Code] >= 2001
        && 'GL Entries'[GL Code] < 3000, 'GL Entries'[Amount] * -1
)

 

Create measure:

 

Total Amount = 
CALCULATE (
    SUM ( 'GL Entries'[Adjusted Amount] ),
    CROSSFILTER ( 'Chart of Accounts'[GL Code], 'Lookup Table'[GL Code], BOTH )
)

 

Result:

 

DataInsights_2-1651155575623.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

6 REPLIES 6
DataInsights
Super User
Super User

@dannywallis1994,

 

Here are two options:

 

1. Use the Profitbase Financial Reporting Matrix. It provides additional functionality such as being able to create subtotal lines. It's a free, certified visual, but certain features require a license to remove the watermark.

 

https://appsource.microsoft.com/en-us/product/power-bi-visuals/wa200000642?tab=overview 

 

2. Create a dimension table that contains the groupings for lines such as EBITDA. Use this dimension table as matrix rows to get the desired groupings.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi DataInsights, thanks for coming back to me. 

 

I think option 2 is the best option. I have started this and works well, however I am unsure how I can group based for EBITDA when it is a product of all revenue GL codes - all cost GL codes?

 

Best, 

@dannywallis1994,

 

I would start by adding a grouping column to your Chart of Accounts table. The logic would be based on GL code (e.g., 4* = Revenue). Then, create a second table that contains all the groupings you want to display in the matrix. This second table allows you to group the Chart of Accounts groupings. For example, Revenue is included in Net Income as well as EBITDA. If you can attach an Excel mock-up of the desired end result, we can delve deeper.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Hi, thanks so much for coming back to me. 

 

I have attached a brief example as well as the desired output.

 

The catagory and sub catagory desired output is working perfectly well, I am just unsure how to also include EBITDA. Maybe I need to add another category? 

 

Best,

 

 Data from business central         
 Calculated table           
 Desired output           
             
             
Genral ledger entries Chart of accounts Calculated look up table Desired Output
GL CodeAmount GL CodeName GL CodeCategorySub category CategorySub CategoryAmount
1001 £                  100 1001Revenue 1 1001RevenueProduct 1 RevenueProduct 1 £        201
1002 £                   101 1002Revenue 2 1002RevenueProduct 1 RevenueProduct 2 £        205
1003 £                   102 1003Revenue 3 1003RevenueProduct 2 RevenueProduct 3 £        104
1004 £                   103 1004Revenue 4 1004RevenueProduct 2 Total Revenue  £        510
1005 £                   104 1005Revenue 5 1005RevenueProduct 3    
2001 £                     50 2001Costs 1 2001CostsProduct 1 CostsProduct 1 £        101
2002 £                     51 2002Costs 2 2002CostsProduct 1 CostsProduct 2 £        105
2003 £                     52 2003Costs 3 2003CostsProduct 2 CostsProduct 3 £          54
2004 £                     53 2004Costs 4 2004CostsProduct 2 Total Revenue  £        260
2005 £                     54 2005Costs 5 2005CostsProduct 3    
          EBITDA  £        250
             
          EBITDA Margin 49%
             
             

dannywallis1994_0-1651132496794.png

Sorry, this is probably more helpul 

@dannywallis1994,

 

Try this solution using the native matrix. It requires more setup, however, and the result is a matrix that may not meet the formatting requirements. I recommend trying the Profitbase Financial Reporting Matrix. Finance users love it, as it offers many advantages including the ability to create subtotals, add blank rows, apply specific formatting, etc.

 

Add EBITDA to the Lookup table, along with an Index column for sorting Category:

 

DataInsights_0-1651155418772.png

 

Data model:

 

DataInsights_1-1651155439735.png

 

In the GL Entries table, create a calculated column to flip the sign. You can also do this in Power Query.

 

Adjusted Amount = 
SWITCH (
    TRUE,
    'GL Entries'[GL Code] >= 1001
        && 'GL Entries'[GL Code] < 2000, 'GL Entries'[Amount],
    'GL Entries'[GL Code] >= 2001
        && 'GL Entries'[GL Code] < 3000, 'GL Entries'[Amount] * -1
)

 

Create measure:

 

Total Amount = 
CALCULATE (
    SUM ( 'GL Entries'[Adjusted Amount] ),
    CROSSFILTER ( 'Chart of Accounts'[GL Code], 'Lookup Table'[GL Code], BOTH )
)

 

Result:

 

DataInsights_2-1651155575623.png

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.