Forum Discussion

mahawkins3's avatar
mahawkins3
Icon for Helper I rankHelper I
9 years ago
Solved

SUM not equalling total when turning column chart into a stack

Hi all,   I'm having an issue whereby adding a variable to the "Legend" of a visualisation gives me numbers that don't add up to the total. Here's the version without the legend (these numbers are ...
  • Anonymous's avatar
    Anonymous
    9 years ago

    Well your formula is a ratio so I wouldn't expect each segment to add up to equal the unsegmented total as a sum. Unless your formula is supposed to the count of all user IDs regardless of segment? Like for each segment you want to divide the sum of the fee value against the count of all user IDs not just the IDs with fees in that segment?

     

    If that's the case then I believe your measure should be

     

    DIVIDE(
    	SUM(Fees[Value]),
    	CALCULATE(
    		DISTINCTCOUNT(Fees[User_ID]),
    		ALL(Fees)
    	)
    )