Can Metabase do the Total

Hi all need one help,

I have a table say TBC which has has fields
date amount product
2020-05-18 17:23:44 400 A
2020-05-19 17:23:44 500 B
2020-06-08 17:23:44 100 A
2020-06-25 17:23:44 700 C
2020-06-18 17:23:44 200 B
2020-07-09 17:23:44 800 C
2020-07-19 17:23:44 900 A

I’ve written this query:

SELECT DATE_FORMAT(date, ‘%M,%Y’) AS date, TBC.product AS revenue, count(*) AS count
FROM TBC
GROUP BY str_to_date(concat(date_format(TBC.date, ‘%Y-%m’), ‘-01’), ‘%Y-%m-%d’), TBC.revenue
ORDER BY str_to_date(concat(date_format(TBC.date, ‘%Y-%m’), ‘-01’), ‘%Y-%m-%d’) DESC, tbc.revenue ASC

This gives me:

revenue July,2020 June,2020 May,2020
A 900 100 400
B – 200 500
C 800 700 –

I now want to have this below one:

revenue July,2020 June,2020 May,2020
A 900 100 400
B – 200 500
C 800 700 –
TOTAL 1700 1000 900

I know I need to use the SUM functio but not sure which field I have to use .

Hi @abhi
That’s currently not available in Metabase:
https://github.com/metabase/metabase/issues/5308 - upvote by clicking :+1: on the first post
There’s an example in the comments of how to modify a query to return a total row.

This is going since 2017 and its 2020 end … and this feature still not there ?? Strange …

@abhi It’s an open source project, so you’re more than welcome to submit a PR. There are older feature request, which hasn’t been implemented yet either. But this feature is scheduled for 0.39 (that’s not a guarantee, but we’ll do our best to try to implement it for that milestone).