I have a database of sales with these columns - date, region, product. I have a viz that calculates the sales using various filters such as total sales for 2016, 2017 and sales for product A, B etc. The profit is a flat 30% of the sales number and isn't a field in the database but can be calculated as a function of the sum of sales. How do I make sure that the profit number stays dynamic and is calculated based on the filter applied (year, product, region). So for e.g. if a worksheet shows sales for 2016 then the profit is calculated for 2016 and not for all the years combined. I am not sure how to do this and if this is a table calculation feature or if I need to set up my database differently. Thank you very much in advance for your time and guidance.
Hello Sarah,
According to your description, there's no profit value in the data, but a constant profit rate 30%.
So just simply create a calculated field to get profit
[Sales] * 0.3
The result works with filters.
The screenshot is a sample created with superstore sample dataset.
If there's any misunderstanding with the problem, please provide a sample workbook or some sample data for further advices.
Regards
Lei