The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.
Hi all,
please help me with the following,
I'm doing a P&L table, and can't figure out how to return a Total Sales.
first let me give you the following info:
1. My P&L template (Table name = GCOA) has the following structure, where ID column is "Code", and P&L uses values from Template column
2. It has connections with Cost and Sales table, (naturally these tables don't have Total Sales Code, only Cost and Sales codes)
I started with simple calculations:
even though, on it's own , measure works,
Total Sales = CALCULATE([Services_R40000], ALL(GCOA[Code])) + CALCULATE([RevenueRebilled_R40210], ALL(GCOA[Code])))
I also tried the following:
I figure out that the issue is that I use codes, but P&L shows only difinitions, and when I try with codes, it works,
but still returns blank for Total Sales
is there a way to assign formula that PL0001 = R40000 + R40210 and also PL0001 = Total Sales???
I tried to do this, so to make Power BI calculate sum to PL0001 and return it as Total Sales:
Hi Ali_Shakh,
There are many tutorials on the internet for financial reproting with Power BI with slightly different approaches. Since for Power BI financial reporting is not a straight forward use case, it's worth to dig into a tutorial to build your solution on a solid foundation. My personal favorite approach is the one from Matt Allington https://exceleratorbi.com.au/build-a-pl-with-power-bi/
Your current problem is that your subtotal lines are just additional lines with text indentation which do not relate to the any rows in your values table. Instead, you need a hierarchy that you can use to activate matrix visual's subtotal experience.
Instead of loading indented lines for your layout, load totaling rows as additional columns and stack them as rows into a matrix visual.
Not
Code | Template |
PL0003 | Total Net Sales |
PL0001 | Total Sales |
R40000 | Services |
R40025 | Customer Rebates |
You need
Code | Row | Subtotal | Total |
R40000 | Services | Total Sales | Total Net Sales |
R40025 | Customer Rebates | Total Sales | Total Net Sales |
Do you see how Total Sales now relates to all the codes of the corresponding values?
Although this approach will solve your problem, I recommend to work through the tutorial and then you can decide which approch is most benefitial for your scenario.
hi @Martin_D ,
thanks for your response 🙂
tbh, using a simple hierarchical table was my initial idea,
but then i watched this video on How to Power BI and changed it
https://youtu.be/J4317R5BvsA
it still bugs me, that I can't solve it the way i described,
anyways thank's for the link
The major difference between your data model and the one in the video is that Bas has no relationship between the report template table and the values table. If you want to build the solution from the video you need to fully adopt the data model structure and measure. Then Bas gives you the option to build a table using text indentation or a matrix using total rows.
You
Relation
Bas
No relatioship
User | Count |
---|---|
14 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
28 | |
19 | |
14 | |
8 | |
5 |