Explore and share Fabric Notebooks to boost Power BI insights in the new community notebooks gallery.
Check it out now!Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more
Hello,
I have a table with multiple columns, including, dates. I am trying to make a dynamic filter for the table visualization in Power BI, so that it will only show the data since the last 2 calendar months (starting from the first day of the month, 2 months ago) until the current month. So, in this case, as from 1 December 2021 until 28 February 2022.
I am thinking maybe do it in DAX? I don't know how to proceed. Any help is much appreciated!
Date | Amount | Country |
01/11/2021 | 44 | China |
06/11/2021 | 44 | Germany |
01/12/2021 | 48 | Indonesia |
19/12/2021 | 50 | Kuwait |
21/01/2022 | 3 | France |
23/01/2022 | 3 | India |
03/01/2022 | 1 | Indonesia |
11/02/2022 | 6 | Brazil |
13/01/2022 | 2 | Germany |
14/02/2022 | 7 | Mexico |
21/03/2022 | 12 | Poland |
Solved! Go to Solution.
@Anonymous
Add a column to your calendar table like this.
Month Offset = DATEDIFF ( TODAY(), Dates[Date], MONTH )
Then you can set a filter on that column for <= 0 and >= -2 and that will give you the last 2 full months and the current month.
Another simple solution is to use the "Date/Time Filters"
@Anonymous
Add a column to your calendar table like this.
Month Offset = DATEDIFF ( TODAY(), Dates[Date], MONTH )
Then you can set a filter on that column for <= 0 and >= -2 and that will give you the last 2 full months and the current month.