I have a table of orders, with contains seller id, order date, amount and country (among other fields). I need a measure that calculates the sum of amounts for the country and year in context. So, for example:
- If I create a table visual with fields ‘year’ and this measure, it will show the total ammount for all countries in each year
- If I create a table visual with fields ‘year’, ‘country’ and this measure, it will show the total ammount for each contry in each year
- If I create a table visual with fields ‘date’, ‘country’ and this meadsure, it will not show the total amount for this day and country, but keeps showing the year total for the country
- If I create a table visual with fields ‘seller id’, ‘date’, ‘country’ and this measure, it will override the ‘seller id’, and keeps showing the year total for the country
This measure, of course, will be affected by any ‘year’ or ‘country’ filter active in the dashboard
I will use this measure later for many purposes. For example, filter in the dashboard only the countries that, for the year selected in context, have ordered more than certain amount
Can you help me, please?