Creating Measure on pivot table to get the % for profit / Loss

SioSho

New Member
Joined
Feb 8, 2022
Messages
7
Office Version
  1. 365
  2. 2021
Platform
  1. Windows
Hi all!

So I'm in a bit of a pickle and its been driving me a little nuts today, Basically I have 3 columns on my pivot table (created the table from Power Pivot / data model / power pivot - not using a table on the actual sheet)
1644397482334.png

what I want to know is the % "Profit" even if it is negative (e.g - xxx% if its a loss) I can do this is normal cells using normal formula, but cant for the life of me translate it to DAX to use as a custom measure (Fx) I also have a Measure for the £ amount of "profit",
1644397592384.png

(to get the profit in £ all i needed to do was SUM('Harvest EXPENSE'[NEG Expense Amount])+SUM('Harvest TIME'[NEG Total Time Cost])+SUM('PR BK INCOME'[Credit]) )

Is there anyway to get this %? (-% for loss +% for profit, so for example if the expenses were a total 100, the income 200, the profit would be 100 which is 50% of 200, therefore the result id want, Id want it to say 50%, If the expenses totalled 100 and the income was 50, there'd be a loss of 50, so -50% would be the result id like to see.

Help Appreciated! (sorry again if this is something super simple I am new :) )
 

Excel Facts

Add Bullets to Range
Select range. Press Ctrl+1. On Number tab, choose Custom. Type Alt+7 then space then @ sign (using 7 on numeric keypad)
For normal fields, you are able to change them tho show the values as something else. That doesn't seem to be available for measures. However, we can create a measure to calculate exactly that.

Calculate the P/L, and then divide that by the max of the expense or income, whichever is greater.
Code:
=(sum(Table6[income])-sum(Table6[software])-sum(Table6[time])) /
MAX(SUM(Table6[income]),SUM(Table6[software])+SUM(Table6[time]))
 
Upvote 0
Solution
For normal fields, you are able to change them tho show the values as something else. That doesn't seem to be available for measures. However, we can create a measure to calculate exactly that.

Calculate the P/L, and then divide that by the max of the expense or income, whichever is greater.
Code:
=(sum(Table6[income])-sum(Table6[software])-sum(Table6[time])) /
MAX(SUM(Table6[income]),SUM(Table6[software])+SUM(Table6[time]))
Thank you So so SOOO Much Severynm!
Its all working I never thought about Using MAX! Ill make sure to read into these functions more,

1644987369215.png


Sio
 
Upvote 0

Forum statistics

Threads
1,224,824
Messages
6,181,186
Members
453,020
Latest member
Mohamed Magdi Tawfiq Emam

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top