Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
105 | |
78 | |
67 | |
63 |
User | Count |
---|---|
148 | |
107 | |
106 | |
83 | |
70 |