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

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.

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

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.

View solution in original post

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

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.

 

View solution in original post

6 REPLIES 6
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.

 

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 have a 5 minute "Current Month Slicer" video here that might be be of use https://youtu.be/5dN4SqufENE

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.

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.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.