'Bottom5 and top5 with DAX formulas and slicers

I hope you are all well.

I have a file here where I have two worksheets: On the “Sheet1”, I have a table with sites, number of overdues and periods. enter image description here

On “Sheet2”, I have a green pivot table that I have created using data modeling.

The question that I have is that (please, check the data modeling) I have created a DAX formula to show the top5 values. The issue that I am facing is that it is considering both periods and that´s why, the green pivot table is only showing three sites: Barcelona, Bologna, and Nettetal. Instead of that, it should show Bologna, Nettetal, Barcelona, Sydney, and Cartago. Additionally, I cannot find any formula to show the bottom5 ones.

What I want to do with the slicers is to show the top5/bottom5 per each period Q1/Q2.

Can you please help me?

Thanks viewotst



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source