For Tweaking Tom Marten's Stacked Bar Chart

I believe the super charged stacked bar chart is new completion. Just a few questions remain:

  1. How do I apply the ranking used in the Simple Other tab within the the Stacked Bar Chart?
  2. How do I add a space and s () around the %, so that the second line in the first bar would read 9.0M (79%).
  3. How to correct the Bar total label to include the first decimal place, so that the UCS bar would reflect 11.4M and the NBU would would show 11.3M?
    Thank you so much for your assistance!
    https://lancemillercpa-my.sharepoint.com/:u:/g/personal/lance_lancemillercpa_onmicrosoft_com/EcW4WmE7FXJGjAtlovx8C8wBt_wmSEKy5L9mlwnddPYtCg?e=owPAjY

Hi @lancemillercpa98.

Q1: How do I apply the ranking used in the Simple Other tab within the the Stacked Bar Chart?
A1: You’ll need to define exactly what the rule is to use to assign stores to the “Other” category: is it just anything other than UCS, NBU, MP? (I doubt it…) is it based on a specific value? Let’s address this one in another thread once the rule is defined [I’ve found a great way to get this correct is to write a DAX measure to get the logic working just the way I want it; then can replicate in Deneb (or just use the DAX measure, if its easier)].

Q2: How do I add a space and s () around the %, so that the second line in the first bar would read 9.0M (79%).
A2: Adjust the transform and add [ (] and [)] after the segment share

    {
      "calculate": "datum['Make'] + '|' + format( datum['$'], '(,.2s' ) + ' (' + format( datum['xSegmentShare'], '.0%' ) + ')'",
      "as": "_combined_label"
    }

Q3: How to correct the Bar total label to include the first decimal place, so that the UCS bar would reflect 11.4M and the NBU would would show 11.3M?
A3: Change the format string from “.2s” to “.3s” (3 significant digits)

        "text": {
          "field": "groupSum",
          "aggregate": "mean",
          "format": ".3s"
        }

Hope it helps.
Greg
eDNA Forum - Deneb Stacked Bar Chart - V4.pbix (1.6 MB)

Thank you Greg! Regarding changing “string from “.2s” to “.3s” (3 significant digits)”, note how the first two bars are at 1 decimal place, while the remaining are at 2?

Yup … AFAIK, Vega-Lite uses D3 formatting from JavaScript, which uses significant digits, not decimal places. I wouldn’t be surprised if there’s an easy way to use decimal places instead, but I haven’t come across it to date.
Greg