Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowGet inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.
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.
User | Count |
---|---|
89 | |
82 | |
47 | |
40 | |
35 |