Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
97 | |
69 | |
46 | |
39 | |
33 |
User | Count |
---|---|
163 | |
110 | |
61 | |
51 | |
40 |