Forum Discussion
Revenue divided by Expense
- 6 years ago
Hi, Anonymous
I am a bit confused about this sentence:
The challenge I have is that the GL Entries that contain the Revenue Lines which need to be calcuated as a total of all the lines and not just exclude them so that we get a total of the operating Expesnses divided by the total revenue.Could you check if this gives you what you are after:
Operating expenses / revenue = DIVIDE ( CALCULATE ( SUM ( GeneralLedger[Amount] ), FILTER ( 'COASort', COASort[Classification] = "Operating Expenses" ) ), CALCULATE ( SUM ( GeneralLedger[Amount] ), FILTER ( ALL ( 'COASort' ), COASort[Classification] = "Revenue" ) ) )Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too. - Anonymous6 years ago
Hi Anonymous ,
You need to create measures and not Calculated Column
Attached is file.
https://drive.google.com/file/d/1L3ZF3FpUB3poIcInAraxhyVuIzlEsrEZ/view?usp=sharing
Regards,
Harsh Nathani
Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!! (Click the Thumbs Up Button)
Hi, Anonymous
I am a bit confused about this sentence:
The challenge I have is that the GL Entries that contain the Revenue Lines which need to be calcuated as a total of all the lines and not just exclude them so that we get a total of the operating Expesnses divided by the total revenue.
Could you check if this gives you what you are after:
Operating expenses / revenue =
DIVIDE (
CALCULATE (
SUM ( GeneralLedger[Amount] ),
FILTER ( 'COASort', COASort[Classification] = "Operating Expenses" )
),
CALCULATE (
SUM ( GeneralLedger[Amount] ),
FILTER ( ALL ( 'COASort' ), COASort[Classification] = "Revenue" )
)
)
Cheers,
Sturla
If this post helps, then please consider Accepting it as the solution. Kudos are nice too.
- Anonymous6 years agoNot applicable
Hello Sturlaws
Sorry for the confusion i think you are on the right track here though.
See attached screen shot
here is the code i attempted to reuse
Operating expenses / revenue = DIVIDE ( CALCULATE ( SUM ( G_LEntries[MTD Actual] ), FILTER ( 'COASort', COASort[Top Level Classification] = "Operating Expenses" ) , CALCULATE ( SUM ( G_LEntries[MTD Actual] ), FILTER ( ALL ( 'COASort', COASort[Top Level Classification]] = "Revenue")))))))))))))))The error message is "The end of the input was reached"- lbendlin6 years ago
Super User
yeah, that code has the sniffles.
Count the opening and closing brackets - they need to eventually zero out, both for the round ones and for the square ones.
Operating expenses / revenue = DIVIDE ( CALCULATE ( SUM ( G_LEntries[MTD Actual] ), FILTER ( 'COASort', COASort[Top Level Classification] = "Operating Expenses" ) ), CALCULATE ( SUM ( G_LEntries[MTD Actual] ), FILTER ( ALL ( 'COASort' ), COASort[Top Level Classification] = "Revenue" ) ) )- Anonymous6 years agoNot applicable
Ha ! Good one.
I will test that code out and report back.
Thank you for helping