Starting December 3, join live sessions with database experts and the Microsoft product team to learn just how easy it is to get started
Learn moreGet certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now
Hello Power BI Gurus,
I'm looking for a simple solution to have a 12 month slicer that dynamically defaults to the latest complete month. For example, while we are in Apr 2023, I wanted to have a slicer with the last 12 complete months: Mar 2023, Feb 2023, ..., Apr 2022 and it defaults to the latest complete month - Mar 2023 in this example. I've come across a few posts that suggest how to make the latest month/current month/today as default but can't figure out how to have a list of months on top of it.
Note: I have a calendar table in my report.
See a screenshot of a similar slicer that I built in another BI platform.
Thank heaps in advance for any suggestsions.
Regards
Hi @Sambath ,
Your second requirement is currently not supported. I've read somewhere in the internet that this may be a thing soon but I can't find that in the current Power BI roadmap. Alternatively, you can add a calculated column that indicates whether period is the latest one.
For your first requirement, you have to create a calculted column to filter the available periods to show only the last 12 ones. Here's a sample formula
Number of Months from Current =
VAR __months =
DATEDIFF ( Dates[Date], MAX ( Dates[Date] ), MONTH ) + 1
RETURN
__months <= 12
Please see attached pbix for your reference.
Proud to be a Super User!
Hi Sambath,
You probably want to apply a relative date filter to your slicer using the date field from your calendar. This wil show al list of the last twelve completed months. Is far as I'm aware you cannot set a dynamic default, but with sort you can set the latest month to show up on top.
Hope this helps!
Thank for the prompt response but I wanted these two features: default to the latest complete month and a list of the last 12 months for users to select.
Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.
User | Count |
---|---|
94 | |
92 | |
83 | |
71 | |
49 |
User | Count |
---|---|
143 | |
120 | |
111 | |
59 | |
57 |