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
konstantinos, that article is specifically about the performance of DIVIDE() vs the construction:
IF(
[Denominator] <> 0
,[Numerator] / [Denominator]
,<what to do for [Denominator] = 0>
)konstantinos
10 years agoMemorable Member
greggyb You are right..