Ad additional filter to chart with top & bottom filter

I have standard sales data, : Product, User, Date, Revenue.
I have a horizontal bar chart that shows bottom 5 user .
I want to add a new filter to the horizontal bar chart that shows the bottom user over $ x revenue over last N weeks.
Please help me add the filter to filter customers over $ x

Hello @ArunM Hope this message finds you well!!

If I understand you well, my suggestion could be trying something like :First, set up a parameter named RevenueThreshold as a Decimal or Integer, depending on your needs, with a default value representing the minimum revenue for filtering. Next, create a parameter called WeeksBack as an Integer to specify how many weeks back you want to consider. Then, create a calculated field to filter dates within the last N weeks using a formula like ifelse({Date} >= addDateTime(-1 * ${WeeksBack}, 'WK', now()), 1, 0). Additionally, create another calculated field to filter users based on the revenue threshold with ifelse({Revenue} > ${RevenueThreshold}, 1, 0). Apply these filters to your bar chart by including only values where IsInLastNWeeks and IsAboveRevenueThreshold are equal to 1. Finally, ensure your bar chart is sorted in ascending order of revenue to display the users with the lowest revenue, and limit the number of bars shown to 5. This setup allows you to dynamically filter your chart to show users with the lowest revenue above a specified amount over the past N weeks, adjusting the parameters as needed for your analysis.

Please, tell me if it helps you

1 Like

Thanks for your suggestion. It worked.

I improvised the ifelse({Revenue}
to
sumOver(sum({Revenue}),[{Product}],POST_AGG_FILTER)
so that the Revenue is sumed across Product dimension.

1 Like