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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Tarek78210
Frequent Visitor

Data Model: creating a P&L per customer

Hi Everyone,

 

I would like to create a P&L per customer in Power Pivot. Then I want to have this P&L via a pivot table with a slicer on the customer type to understand the profitability by customer type. Let me explain myself.

 

I have some dimension tables such as Period, Cluster (which is the customer), division (location of the customer), debtor type (big customer, medium, small).

 

The first data table is from one source which gives the revenue and margin per customer name. I would like my P&L to take the revenue from this table.

 

I will add a final data table which gives the P&L data (revenue, margin, costs etc.). We don't have any vision of customers.

 

So I won't to create the following P&L

 

Revenue > from the Fact_Revenue table because I have the revenue per customer

Margin > from the Fact_Revenue table because I have the margin per customer

Expenses > from the Fact_P&L table I will add.

 

Thanks,
P&L per customer.PNG

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi, @Tarek78210 

Based on your information, I create sample tables:

vyohuamsft_0-1726040462105.png

 

Then create measures:

Total Margin = SUM('Fact_Revenue'[Margin])
Total Revenue = SUM('Fact_Revenue'[Revenue])
Total Expenses = 
VAR TotalRevenueAll = CALCULATE(SUM(Fact_Revenue[Revenue]), ALL(Fact_Revenue))
VAR TotalExpensesAll = 21000  -- Let's assume that the total cost is:21000
RETURN
SUM(Fact_Revenue[Revenue]) / TotalRevenueAll * TotalExpensesAll

 

Put them in table view, and put DebtorCategory in slicer. Here is my preview:

vyohuamsft_1-1726040636213.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi, @Tarek78210 

Based on your information, I create sample tables:

vyohuamsft_0-1726040462105.png

 

Then create measures:

Total Margin = SUM('Fact_Revenue'[Margin])
Total Revenue = SUM('Fact_Revenue'[Revenue])
Total Expenses = 
VAR TotalRevenueAll = CALCULATE(SUM(Fact_Revenue[Revenue]), ALL(Fact_Revenue))
VAR TotalExpensesAll = 21000  -- Let's assume that the total cost is:21000
RETURN
SUM(Fact_Revenue[Revenue]) / TotalRevenueAll * TotalExpensesAll

 

Put them in table view, and put DebtorCategory in slicer. Here is my preview:

vyohuamsft_1-1726040636213.png

 

How to Get Your Question Answered Quickly

Best Regards

Yongkang Hua

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

DataNinja777
Super User
Super User

Hi @Tarek78210 ,

 

To prepare a P&L by customer, you can use the Fact_Revenue table for both revenue and cost of goods sold (CoGS). However, for expenses, an allocation method will be required since these are typically fixed costs that cannot be directly attributed to specific customers. For example, your sales departments or sales representatives may serve only certain customers, so their costs should be allocated within the group of customers they manage. In contrast, back-office costs, which are not tied to any specific customers, are generally allocated evenly across all customers.

If you would like more details, I’d be happy to assist further.

 

Best regards, 

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.