'How to show by default based on latest 3 months available in the records in Power Bi

I need to show the power bi report based on the latest 3 months which is available in the records. For example if the latest month that available in the record is December 2021. Then power bi should show only Decemeber 2021,November 2021, October 2021(Which are the latest 3 months ). Suppose if there is no records for November 2021 then my report should show December 2021,October 2021,September 2021.



Sources

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

Source: Stack Overflow

Solution Source