Forum Discussion
rahkim
4 years agoHelper I
Custom Summary Total in Table Visual
Greetings! I am using a table visual with three columns (starting and ending dollars, and a percentage of the difference). I would like to have the percentage at the bottom show the percentage d...
- 4 years ago
hi rahkim
Can you adjust measure to following. I haven't tested syntax. If it does not work, I'll correct in the morning as I am currently on phone.
Measure =
VAR _1 = SUMX ( Table , Table[Start Dollars] )
VAR _2 = SUMX ( Table , Table[End Dollars] )
VAR _3 = ( _1 - _2 ) / _1
RETURN
IF ( _3 = 0 , 0 , _3 )
TheoC
4 years agoCommunity Champion
hi rahkim
Can you adjust measure to following. I haven't tested syntax. If it does not work, I'll correct in the morning as I am currently on phone.
Measure =
VAR _1 = SUMX ( Table , Table[Start Dollars] )
VAR _2 = SUMX ( Table , Table[End Dollars] )
VAR _3 = ( _1 - _2 ) / _1
RETURN
IF ( _3 = 0 , 0 , _3 )
rahkim
4 years agoHelper I
Interesting. Those fields on the table were just the actual values - not measures. But when I turned them into measures, the rows showed the same amount and the total showed the correct %! I did not know that.
Here is a sample chart with the new cols (measures) without color.
The -46.83 was what I needed. Does this work because it sums the measures on the overall, and not per row? Thanks!
- rahkim4 years agoHelper I
BTW... I used this as my measures:
TotalStart = SUM('Table1'[StartDollars])TotalEnd = SUM('Table1'[EndDollars])TotalPct = DIVIDE([TotalEnd]-[TotalStart],[TotalStart])