Canvas dropdown filter

how can I exploit the "dropdown column" : for example i am showing a metric (costs), and I want to display the "costs" of different "categories".
When it's on 'any' it gives me a correct value which is the sum of the costs of different categories.
However, when I choose one of the "categories" , It is all the time giving me 0.
So, can you tell me please how can I proceed?

Hi wadhah, it sounds like something is mismatched between the value and filter columns you are deriving for the dropdown column. Could you copy/paste the expression you are generating?

Hello @tims,
Thank you for the update.
Here's my metric's expression:
| essql
query="SELECT SUM(Costs)
FROM "azureconsumption*"
| math "SUM_Costs_"
| metric "Euros"
metricFont={font size=48 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align="center" lHeight=48}
labelFont={font size=14 family="'Open Sans', Helvetica, Arial, sans-serif" color="#000000" align="center"}
| render

And Here's the the filter'S expression:
query="SELECT ConsumedService
FROM "azureconsumption*"
GROUP BY ConsumedService"
| dropdownControl valueColumn="ConsumedService" filterColumn="ConsumedService"
| render

Ok, so I think that you need to update your Costs query to be grouped by ConsumedService so that the value that you are passing in via filterColumn will actually have a corresponding column in the Costs query. If you visualize your Costs query as a datatable you will see that right now it is only returning the total sum not broken out by ConsumedService.

Here is a similar question that was posted a while back that may give you a better idea of some things to try.

Hey @tims thank you for your response.
However I disagree about the fact concerning datatable, because if i pass these sql commands:

SELECT ConsumedService, SUM(Costs)
FROM "azureconsumption*"
GROUP BY ConsumedService

I get myself a table showing me each ConsumedService and its amount of costs during this month.

so if you use that query, and you name your SUM(Costs) column "sumCosts" or something and then use that column name in the filterColumn, it still returns 0?

Yes @tims it still returns 0

Hey @wadhah, ok I've attempted to re-create your issue and I think I have using some sample data. It looks like you may be encountering this bug:

At this point it sounds like your queries are correct and I could reproduce the dataset coming back as 0 whenever I had categories with spaces or mixed case values, so if your ConsumedService value is a string with either spaces or mixed case then it is filtering incorrectly because of this bug.