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
Anonymous
Not applicable

Default Slicer to latest Month having data

Hi All,

 

Is there any way through which we can default the slicer to the latest Month having data or  to the Current Month  when the refresh happens?

We have a Month Slicer from Jan- Dec and the requirment is to show always the latest Month or Latest Month having data in the slicer when the report opens up. 

I am aware of the Relative DateTime Filtering. But this won't work in our case as the user wants to see all the Months in the slicer and would use the previous  months also for their analysis.

 

Requesting your help on this.

 

1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@Anonymous 

To achieve this, you need to create a column in your dates table as 

 

Last Business Date = Dates[Date] <= LASTDATE(ALL(FactTable[Business Date]))

 

Now, insert this Column on the Filter Pane on the Filter on All Pages  section.

By doing this, your date slicer will automatically be updated as new data get added to your fact table.

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

5 REPLIES 5
v-agutta
Employee
Employee

Hi @Fowmy , We are also facing the same issue. I have created a column with the formula given for Last Business Date. I m getting True/Flase result. Is this expected to come like this?

And if it is expected how we can get the latest month get selected on the slicer visual?

Fowmy
Super User
Super User

@Anonymous 

For future dates, you will have to modify your DAX measures with a copy of the calendar.
Using Max and the last date is the in this case.

 

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy  could you please elaborate.

Copy of Date Table  means, we have to create a seperate dim date table  to acheive this?

Fowmy
Super User
Super User

@Anonymous 

To achieve this, you need to create a column in your dates table as 

 

Last Business Date = Dates[Date] <= LASTDATE(ALL(FactTable[Business Date]))

 

Now, insert this Column on the Filter Pane on the Filter on All Pages  section.

By doing this, your date slicer will automatically be updated as new data get added to your fact table.

________________________

If my answer was helpful, please click Accept it as the solution to help other members find it useful

Click on the Thumbs-Up icon if you like this reply 🙂


Website YouTube  LinkedIn

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy  Thanks for the quick reply.

But we have future dates also in our Fact Table (Plan Data for 2020, 2021..)

So i it advisable to use LASTDATE function here?

 

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.