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.
Hi,
I have a Finance report for which i need to calculate P&L, can you please help me in the calculation, below is the screenshot of my report.
Solved! Go to Solution.
If you need the difference between Revenue and Expense, try:
Difference =
VAR Rev = CALCULATE([Sum of Values], FILTER(Table, Table [Acct Type] = "Revenue"))
VAR Exp = CALCULATE([Sum of Values], FILTER(Table, Table [Acct Type] = "Expense"))
RETURN
Rev-Exp
Proud to be a Super User!
Paul on Linkedin.
If you need the difference between Revenue and Expense, try:
Difference =
VAR Rev = CALCULATE([Sum of Values], FILTER(Table, Table [Acct Type] = "Revenue"))
VAR Exp = CALCULATE([Sum of Values], FILTER(Table, Table [Acct Type] = "Expense"))
RETURN
Rev-Exp
Proud to be a Super User!
Paul on Linkedin.
Thank you so much this worked
Hi,
Thank you for the reply but can you be precise and explain me what values go for
CALCULATE([Sum of Values]
also I need running totals for my data
Apologies for being vague...
[Sum of Values] refers to the measure you are using in your matrix in the values bucket (so whatever measure you are using)
As for the running totals, can you please provide more info? (a depiction of what you expect to see, the strucure of your model, the fields you are using in the matrix visual as rows/columns...). Running totals depend on the filter context, so the pertinent info is essential.
Proud to be a Super User!
Paul on Linkedin.
Thank you Paul for the help, the formula worked, I have another question
1) Can we make Expense all +ve(postive sign), but still have Revenue-Expense -ve(negative sign) in the below report
2) Can we control the order of different Revenue and Expense types in the same report
Looking forward for the reply
Thanks in Advance
I'm not too sure what you mean. If your expenses are -ve values and you want to display them as such all you have to do is change the measure to:
Difference =
VAR Rev = CALCULATE([Sum of Values], FILTER(Table, Table [Acct Type] = "Revenue"))
VAR Exp = CALCULATE([Sum of Values], FILTER(Table, Table [Acct Type] = "Expense"))
RETURN
Rev + Exp
Notice how the "return" now has a "+"
If, however, your Expenses are -ve values, but you want to display them as +ve values you have 2 options:
1) Create a new measure and multiply the [Sum of Expenses] *-1. In this case the value itself changes to +ve, so the [Difference] measure must remain Rev - Exp
2) Simply change the display format for the original measure: you can change the display format for the measure under the modeling view. Select the measure in the model view, go to properties, Formatting and select custom. The second expression in the string corresponds to the -ve values. Change it so that it is the same as the +ve values string.
This will ONLY change the display format; the value actually remains -ve (see depiction below: the measure [Check formatted values] is multiplying the Formatted measure *1), so the [Difference] measure must be Rev + Exp
Here is depiction of the options:
As regards the order of the rows, the best way to do this is to include an "Order" column in the Dimension tables for "Revenue" and "Expenses":
1) This is easy to do in Power Query: create a conditional column in each dimension table and establish the order value for each of the rows.
2) Alternatively you can do this in Excel by recreating the dimension tables in Excel, write the order values for each row, import the tables to the model to become your dimension tables and establish a one-to-many relationship with the fact tables).
Then go to the tabel view for the dimensions, select the "Revenue" and "Expense" columns, and use the function in the ribbon "Sort column by" and choose the "Order" column.
Let us know if you get stuck!
Proud to be a Super User!
Paul on Linkedin.
Thank you so much your DAX for Rev-Exp worked.
I will be grateful if you help me in achieving the P&L report like the one below, where the Revenue is summed up like thefirst row in the table, rather than showing subtotals like the my previous image
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
146 | |
109 | |
106 | |
88 | |
61 |