Struggling to understand how to properly generate a (grouped) bar chart like the one in this example:
My Prometheus metrics are like this:
articles_sellable_total{location="Warehouse0", sellable="false"} 0
articles_sellable_total{location="Warehouse0", sellable="true"} 2
articles_sellable_total{location="Warehouse0", sellable="false"} 0
articles_sellable_total{location="Warehouse0", sellable="true"} 43
articles_sellable_total{location="Warehouse1", sellable="false"} 100
articles_sellable_total{location="Warehouse1", sellable="true"} 21
articles_sellable_total{location="Warehouse1", sellable="false"} 2
articles_sellable_total{location="Warehouse1", sellable="true"} 15
articles_sellable_total{location="Warehouse2", sellable="false"} 1
articles_sellable_total{location="Warehouse2", sellable="true"} 8
articles_sellable_total{location="Warehouse2", sellable="false"} 22
articles_sellable_total{location="Warehouse2", sellable="true"} 11
And so, I've been following the docs, then trying to group like
sum by (location, sellable) (articles_sellable_total{})
but in the Table view in Grafana it gives me something like
Time {location="Warehouse0", sellable="false"}
2024-03-25 14:19:00 0
2024-03-25 14:19:30 0
2024-03-25 14:20:00 0
2024-03-25 14:20:30 0
also variants like count by (location, sellable) (articles_sellable_total{}) and sum by (location) (articles_sellable_total{sellable="true"}) + (articles_sellable_total{sellable="false"})
So either the location is not persisted, or the table view gives nonsense, or the x-axis is just messed up.

Bar chart panel expects data in format
Your initial query is just fine in terms of providing needed data. But it requires some massaging to put it into expected format.
First, to leave only latest values and present them in an easier form for following steps change query options to Format: Table, Type: Instant (Options block under query editor).
Then to "transpose" table into expected format add Transformation Grouping to Matrix with Column set to
sellable, Row tolocation, and Cell value left asValue.After that in Table view you should see something like
And bar chart view should present you groups of bars per
location, with two bars in each grouptrueandfalse. If you want goupping to happen the other way around, you can switch places for Row and Column options in transformation.