Power BI -- show only selected time of data

I’ve created a time slicer that allows users to select data for either the last 12 months or the last 24 months. However, I want my bar chart to display the corresponding period of data as well.

For example, when I click the “last 12 months” option, the chart should only display data from February 2023 to the current month (February 2024), and all other periods should be neglected. I’ve also attached my current dashboard to this post for reference. Thanks!

It appears that sum by zero is the cause. Can you send pbix?