cancel
Showing results for
Did you mean:
Frequent Visitor

## % of Grand Total for Any Field

Hi All

Referring to my first table, my DAX formula for ALL is: Calculate(Sum(Players), ALL(Table[Sport]))

Can I write a generic ALL statement so that if the user changes the context (instead of sport, use location), the % of Total will still work?

I have tried to reference the entire table within the ALL but it doesn't seem to work. Thanks!

 Sport Players ALL DAX % of Total Tennis 25 60 42% Basketball 20 60 33% Football 15 60 25% 60 Location Players ALL DAX % of Total ABC 12 60 20% DFC 25 60 42% EFG 23 60 38% 60
2 REPLIES 2
Established Member

## Re: % of Grand Total for Any Field

@swwong1 , please send a screenshot of the relationship view.  It will really help us understand the best way to solve this.

It sounds like the SUM(Fact_Table[Players]) is your main measure, coming from what I'm calling the Fact_Table.

I'm going to assume that TableName[Sports] is a dimension table that has a relationship to Fact_Table?

Does [Location] column reside in another dimension table with a different relationship to Fact_Table?

If so, you could write the following DAX:

```All Calc :=
CALCULATE(
SUM(Fact_Table[Players])
,ALL(Fact_Table)
)```

This will remove any filter on any column in the (expanded) Fact_Table.  This means that any filter on any column that is related to Fact_Table will be removed as well.

Again, knowing what your data model looks like (and which columns belong to which tables) will greatly help us solve this problem.

Super User III

## Re: % of Grand Total for Any Field

If location is a seperate table, you'll need a different query than if it's in the same table.

What does your table structure look like at the moment?

Announcements

#### Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

#### 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!