Forum Discussion
Anonymous
10 years agoNot applicable
Percent of Total
I cannot find the DAX formula that will give me the % of Total results. I added a calculated field (%) to the below power BI table. In that column I am trying to get it to display the results as sh...
- 10 years ago
Greg_Deckler, I think you meant to use CALCULATE() or switched the order there.
TotalQuantity = SUM( 'Table'[Quantity] ) % Total = [TotalQuantity] / CALCULATE( [TotalQuantity] ,ALL( 'Table' ) ) ***OR*** TotalQuantity = SUM( 'Table'[Quantity] ) % Total = [TotalQuantity] / SUMX( ALL( 'Table' ) ,'Table'[Quantity] )Either construction would work, but I'd lean toward the former idiom.
greggyb
10 years agoResident Rockstar
Greg_Deckler, I think you meant to use CALCULATE() or switched the order there.
TotalQuantity =
SUM( 'Table'[Quantity] )
% Total =
[TotalQuantity]
/ CALCULATE(
[TotalQuantity]
,ALL( 'Table' )
)
***OR***
TotalQuantity =
SUM( 'Table'[Quantity] )
% Total =
[TotalQuantity]
/ SUMX(
ALL( 'Table' )
,'Table'[Quantity]
)Either construction would work, but I'd lean toward the former idiom.
SA_NYC
8 years agoAdvocate I
Thanks so much for this, it was surprisingly hard to find a concise write-up on how to do this. I think this about the fifth time I've used one of your DAX approaches, so your contributions are very much appreciated.