cancel
Showing results for
Did you mean:
Occasional Visitor

## Simple Calculation Required - DAX formula

I have quite a simple query

I've made a dashboard without having to use DAX. I've now hit a wall and through my research I think I need to use a DAX formula. I've never used this before so your help will be VERY much appreciated

So I created a Table using the Visualisation palette and I have a few other charts on the page that filter this table. However I do want one column in this table to remain static and this is a Unit cost value. If I were to do this on Excel, it would be using a SUMIF, and would sum all the costs in a particular column and group it by a category, for this example lets assume I'm grouping the costs by a country. Now this dashboard has a chart that filters by City, however I don't want the country Unit cost to change as I filter out these cities. What is the formula that I need to use? From my research I think it will be a combination of CALCULATE, ALL and SUM however I've have no luck with this.

Your speedy help with this otherwise simple question will be very much appreciated!

Super User II

## Re: Simple Calculation Required - DAX formula

Can you add sample tables (in format that can be copied to PowerBI) from your model with anonymised data? Like this (just copy and paste into the post window).

 Column1 Column2 A 1 B 2.5

based on what you wrote, and assuming everything is in one table, something like this should work:

`Measure = CALCULATE(SUM('Table'[Unit cost]), ALL('Table'[City]))`

it negates the filters you put on the cities, so it should give the total per country

Thank you for the kudos 🙂

Proud to be a Datanaut!

Announcements

#### Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

#### Super User Challenge: Can You Solve These?

We're celebrating the start of the New Super User season with our first ever Super User 'Can You Solve These?' challenge.

#### Power BI Desktop Update - February 2020

We are super excited for our update this month, as we are releasing two of our top community requests!