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
BigKev
Helper III
Helper III

Automatic select the latest date in the data

Hi All,

 

Does anyone know how I can set power bi to automatically select the latest date in my data?

Currently, this is my filter: 

BigKev_1-1617015564073.png

 

When April Data becomes available, I want power BI to automatically select the April -21 value.

 

How can I achieve this without having to manually select the filter, and republish my report every month?

 

Cheers,

Kev

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @BigKev ,

 

yes, you should add a calculated column in your date table and check there if the row is the latest date.

If yes, then give it a value like "Latest" otherwise not. 

 

Then you can use that column as a slicer. As the report refreshes this column is also getting refreshed.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

View solution in original post

2 REPLIES 2
v-robertq-msft
Community Support
Community Support

Hi, @

As far as I’m concerned, there’s no option to set the default value for slicer in Power BI at current, I think that the only way is to create a measure to filter the slicer to always display the latest date, you can try this:

  1. Create a calculated column in the date table:
Datediff = DATEDIFF([Date],TODAY(),DAY)
  1. Create a measure:
Is latest date =

var _mindate=MINX(FILTER(ALL('Date'),[Date]<TODAY()),[Datediff])

return

IF(MAX('Date'[Datediff])=_mindate,1,0)
  1. Create a slicer and apply a filter to this slicer:

v-robertq-msft_0-1617180818826.png

 

And the slicer can always display the latest date.

You can download my test pbix file here

 

If this result is not what you want, you can go to the Power BI Idea to submit a new idea so that people with the same idea can vote for you. I will also vote for you.

 

Best Regards,

Community Support Team _Robert Qin

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

selimovd
Super User
Super User

Hey @BigKev ,

 

yes, you should add a calculated column in your date table and check there if the row is the latest date.

If yes, then give it a value like "Latest" otherwise not. 

 

Then you can use that column as a slicer. As the report refreshes this column is also getting refreshed.

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍
 
Best regards
Denis
 

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.