cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
swwong1 Frequent Visitor
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!

 

SportPlayersALL DAX% of Total
Tennis256042%
Basketball206033%
Football156025%
 60  
    
LocationPlayersALL DAX% of Total
ABC126020%
DFC256042%
EFG236038%
 60  
2 REPLIES 2
ChrisHaas Established Member
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
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?

Helpful resources

Announcements
Coming Soon: T-Shirt Design Contest

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!

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?

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

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!

Power Platform Online Conference

Power Platform Online Conference

Join us for the first ever Power Platform Online Conference!

Top Solution Authors
Top Kudoed Authors