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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! 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
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.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.