Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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.
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
63 | |
62 | |
52 | |
39 | |
24 |
User | Count |
---|---|
85 | |
57 | |
45 | |
43 | |
38 |