cancel
Showing results for
Did you mean:
Frequent Visitor

## SUM AND SUBTRACT

I would like to sum two columns salary and other overheads column then subtract gross profit from it . Below is my formula

EBITDA = ('Fin 2'[SalarY]+'Fin 2'[Other overheads])-'Fin 2'[Gross Porif]

Is there a better way to do this as am new to Dax

Thanks.

1 ACCEPTED SOLUTION
Community Support

Hi @oolamide85,

I made one sample for your reference. The first one is the same as yours. For the second one, it will ignore all the filter.

`Measure = CALCULATE(SUM('Fin 2'[SalarY])+CALCULATE(SUM('Fin 2'[Other overheads])-CALCULATE(SUM('Fin 2'[Gross Porif]))))`

`all = CALCULATE(SUM('Fin 2'[SalarY]),ALL('Fin 2'))+CALCULATE(SUM('Fin 2'[Other overheads]),ALL('Fin 2'))-CALCULATE(SUM('Fin 2'[Gross Porif]),ALL('Fin 2'))`

Also you can get more details from the attachment. If any other question, feel free to let me know please.

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
2 REPLIES 2
Super User

Hi,

One cannot refer to bare columns when writing measures.  Try this measure

EBITDA = SUM('Fin 2'[SalarY]+'Fin 2'[Other overheads]-'Fin 2'[Gross Porif])

Regards,
Ashish Mathur
http://www.ashishmathur.com
Community Support

Hi @oolamide85,

I made one sample for your reference. The first one is the same as yours. For the second one, it will ignore all the filter.

`Measure = CALCULATE(SUM('Fin 2'[SalarY])+CALCULATE(SUM('Fin 2'[Other overheads])-CALCULATE(SUM('Fin 2'[Gross Porif]))))`

`all = CALCULATE(SUM('Fin 2'[SalarY]),ALL('Fin 2'))+CALCULATE(SUM('Fin 2'[Other overheads]),ALL('Fin 2'))-CALCULATE(SUM('Fin 2'[Gross Porif]),ALL('Fin 2'))`

Also you can get more details from the attachment. If any other question, feel free to let me know please.

Regards,

Frank

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Announcements

#### Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

#### Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

#### What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

#### Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!

Top Solution Authors
Top Kudoed Authors