cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Anonymous
Not applicable

## Summing expenses for only 2 items in a column

Hi

I am only new to Power BI and I need the sum of only 2 items in my table. E.g., I have a list of the following items with the expense next to them. All items are in the table for each month.

Cost of Sales      Cost of Sales expense

Training hire           80000

Resources               20000

Wages                    90000

venue hire             10000

I only want to calculate the sum of all Training hire and resources. I need to do a filter on my cost of sales column and the expenses together. I know it is easy but I am having difficulties getting in correct.

I have used:

Cost of 2 items = CALCULATE(sum('Cost of Sales'[Cost of Sales Expense]),('Cost of Sales'[Cost of Sales]="Training - Resources & Printing"),('Cost of Sales'[Cost of Sales]="Training - Venue Hire"))

but it isn't bringing anything up. It works when I just use the one filter so I am guessing I am adding the second filter incorrectly but I am not sure how to add it this dax.

Any assistance would be appreciated.
Thank you.
1 ACCEPTED SOLUTION
Impactful Individual

Hi @Anonymous ,

Use the below DAX:

Cost of 2 items = CALCULATE(SUM('Cost of Sales'[Cost of Sales Expense]), FILTER('Cost of Sales','Cost of Sales'[Cost of Sales]="Training - Resources & Printing" || 'Cost of Sales'[Cost of Sales]="Training - Venue Hire"))

I hope this helps!
Mark it as a solution if it answers your question. Kudos are always appreciated!

Thanks.

4 REPLIES 4
Anonymous
Not applicable

Thank you Tanushree_Kapse.  Fantastic. Thank you again for your prompt response. It is appreciated.

Impactful Individual

Hi @Anonymous ,

Use the below DAX:

Cost of 2 items = CALCULATE(SUM('Cost of Sales'[Cost of Sales Expense]), FILTER('Cost of Sales','Cost of Sales'[Cost of Sales]="Training - Resources & Printing" || 'Cost of Sales'[Cost of Sales]="Training - Venue Hire"))

I hope this helps!
Mark it as a solution if it answers your question. Kudos are always appreciated!

Thanks.

Super User

@Anonymous , Try like

Cost of 2 items = CALCULATE(sum('Cost of Sales'[Cost of Sales Expense]), filter('Cost of Sales', 'Cost of Sales'[Cost of Sales] in {"Training - Resources & Printing","Training - Venue Hire"}))

Anonymous
Not applicable

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

#### Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors