Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don'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.

Reply
ckwongak
Frequent Visitor

How to make slicer default showing latest month as the selection when new data come in every month?

I have a dashboard which contains a slicer for user to select different month of data, the data will refreshed monthly. However, I don't know how to make the slicer automatically pointing to the latest month after each refresh, is this possible to do so in Power BI?

3 ACCEPTED SOLUTIONS
MattAllington
Community Champion
Community Champion

What I normally do is add another column I'm the calendar table that mirrors a unique month column, eg mmm-yyyy.  Write a formula for the column (Power Query or DAX calc column, better in PQ, I think)) that returns "Current Month" for the active month and "mmm-yyyy" for the other months. Sort this on anothe unique month column such as mmm-yyyy or month end date. Once done, use this new column and set to "current month". Each month (during refresh), the actual current month changes but the slicer stays the same. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

View solution in original post

wynhopkins
Most Valuable Professional
Most Valuable Professional

I have a 5 minute "Current Month Slicer" video here that might be be of use https://youtu.be/5dN4SqufENE

MVP | Author of Power BI for the Excel Analyst | Speaker | Power BI & Excel Developer & Instructor | YouTube- 5 million views | Fan of Power Query & XLOOKUP | Purpose: Making life easier for people through applying and sharing knowledge.

View solution in original post

Hi @ckwongak 
You can catch your selection with dax code :

selected period = "Selected period is " & min('Table'[Date]) & " - " & max('Table'[Date])
and to put it on a small card under the slicer:
Ritaf1983_0-1684723616422.png

If my answer was helpful please give me a Kudos and accept as a Solution.

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

7 REPLIES 7
ckwongak
Frequent Visitor

But is it possible to show the Actual date in yyyy-mm-dd instead of "Currnet Date"/"Latest Date"?

Hi @ckwongak 
You can catch your selection with dax code :

selected period = "Selected period is " & min('Table'[Date]) & " - " & max('Table'[Date])
and to put it on a small card under the slicer:
Ritaf1983_0-1684723616422.png

If my answer was helpful please give me a Kudos and accept as a Solution.

 
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

You will need to compromise, somewhere. You could put the new column i described in the filters pane and a card showing the actual date. I cannot think of a way to have a slicer showing the actual date AND allowing the user to select a different date. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.
wynhopkins
Most Valuable Professional
Most Valuable Professional

I have a 5 minute "Current Month Slicer" video here that might be be of use https://youtu.be/5dN4SqufENE

MVP | Author of Power BI for the Excel Analyst | Speaker | Power BI & Excel Developer & Instructor | YouTube- 5 million views | Fan of Power Query & XLOOKUP | Purpose: Making life easier for people through applying and sharing knowledge.
Ritaf1983
Super User
Super User

Hi @ckwongak ,
Assuming I understand your needs correctly, the following tutorial may help:
https://www.youtube.com/watch?v=JlVHsZUk1nc

If my answer was helpful please give me a Kudos and accept as a Solution.

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
MattAllington
Community Champion
Community Champion

What I normally do is add another column I'm the calendar table that mirrors a unique month column, eg mmm-yyyy.  Write a formula for the column (Power Query or DAX calc column, better in PQ, I think)) that returns "Current Month" for the active month and "mmm-yyyy" for the other months. Sort this on anothe unique month column such as mmm-yyyy or month end date. Once done, use this new column and set to "current month". Each month (during refresh), the actual current month changes but the slicer stays the same. 



* Matt is an 8 times Microsoft MVP (Power BI) and author of the Power BI Book Supercharge Power BI.
I will not give you bad advice, even if you unknowingly ask for it.

Hello there, this solution works really well. However, I am wondering if you have a solution for default loading to CurrentMonth when accessing the Power BI Service? Currently, my slicer loads to the month when the pbix was published.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.