Loading

Sorting Stacked Bars by the Percentage of One Segment

Publiceringsdatum: Feb 19, 2026
Uppgift

How to sort the stacked bar graph by the percentage of one segment just like below.
User-added image

Steg
Create a calculation to get the percentage of the segment and sort the view by it. Please refer to the attached sample workbook as well as the video for more details.

1. Make a calculation like below to the percentage for 'Home Office'.
IF ATTR([Segment]) = "Home Office"
THEN SUM([Sales]) / TOTAL(SUM([Sales]))
ELSE 0
END

2. Add this field to [Columns] Shelf along with the original measure

3. Edit table calculation Compute Using > Cell to show the right percentage

4. Sort the view by the percentage calculation.
 
Knowledge-artikelnummer

001456922

Bilagor

Sort with Percentage_v2018.3.twbx

1243 KB

Sort with Percentage.mp4

3772 KB

 
Laddar
Salesforce Help | Article