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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
dpombal
Post Patron
Post Patron

Get max date (max of a field) in Slicer as default value

Hi all,

 

I have a fairly simple dataset (simulating a real case)

 

Table includes several snaphots of the same data, using Date_of_Update

 

 1 excel data.PNG

 

 

 

 

 

 

 

 

 

 

So for consuming this table , selecting a Date of Update is mandatory (Selecting full table makes no sense)

 

I should require , a slicer with Date update, having as default value, the max of Date of Update

 

How to predefine a slicer with the MAX of a field , or a page filter?

 

2 pbi.PNG

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Regards

 

2 ACCEPTED SOLUTIONS
Anonymous
Not applicable

You can add a calculated column to your Date table:

 

IsLastDate = Date[Date] = MAX(Table[Date_Of_Update])

The value will be TRUE for the last Date_Of_Update and FALSE for the rest.

Then you can use this column as a report level filter

View solution in original post

@dpombal,

It depends on your requirement. You can create a slicer using the IsLastDate calculated column instead of dragging the calculated column into report level filter. Report level filter will filter slicers and visuals in all report pages 

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

8 REPLIES 8
Chihiro
Solution Sage
Solution Sage

Other than saving PBIX with max date selected. There is currently no function for slicer to auto select some value.

 

Alternatives I've used in the past is to create Measures/Visuals using FILTER() function to show data for latest date.

 

Then have it as default view. And have shape with link to bookmark to show Visuals for entire dataset (and hide initial visuals for latest date), if user clicks on it.

This solution is very costful in a model with 150 measures, appart from that, take into account entire dataset makes no sense, you should always filter 1 date of update, aggregating all is not useful

 

Then have it as default view. And have shape with link to bookmark to show Visuals for entire dataset (and hide initial visuals for latest date), if user clicks on it.

 

 

I was thinking on something like  calculated column...and using it as page filter...but not sure how it works with a slicer....any idea?

I would consider splitting model into two then.

 

One for small segment with fine grain (i.e. MAX([Date])).

 

Then another for whatever other level you currently have.

 

Alternately, as have been mentioned, use calculated column, use that as Page level filter criteria.

Then again use bookmark to flip between the two (or use filter pane).

Anonymous
Not applicable

You can add a calculated column to your Date table:

 

IsLastDate = Date[Date] = MAX(Table[Date_Of_Update])

The value will be TRUE for the last Date_Of_Update and FALSE for the rest.

Then you can use this column as a report level filter

How will this report level filter collide with An slicer? if it is filtered by a report level, I think a slicer will not be effective

@dpombal,

It depends on your requirement. You can create a slicer using the IsLastDate calculated column instead of dragging the calculated column into report level filter. Report level filter will filter slicers and visuals in all report pages 

Regards,
Lydia

Community Support Team _ Lydia Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Greg_Deckler
Super User
Super User

Well, you could select the max date and save the PBIX.


@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

This solution is not valid for me, imagine tomorrow a latest date appears in the dataset , thanks

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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