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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Automatically select latest date in slicer

Hi! 

I need my slicer to select the latest date available when I refresh the report and filter data in the table to that date. All previous dates should still show in the slicer in case the user needs to look at previous dates. 

 

Right now, I just manually select the lastes date when the report refreshes. Is this even possible? I've been looking into custom columns and M queries but I do not understand it. 

 

UnknownValue_0-1644685998582.png

 

3 REPLIES 3
Anonymous
Not applicable

IF
(Processed[Report Date] < (Processed[MAX DATE]),
FORMAT(Processed[Report Date],"yyyy-mm-dd"),
"Latest")

This works if you create a separate column with MAX date
I am sure there a more elegant way to do this but I am not that savy yet
David-Ganor
Resolver II
Resolver II

Hi @Anonymous,

 

Please review the following video - replace Today with Max(date):

 

https://youtu.be/VaJ10ilXp6Y 

Anonymous
Not applicable

Thank you David, I have modified the code in the video to fit my dataset but I have an error somewhere, I do not see it. Return value is "Today" for all the rows for some reason. When I use MAX function alone, I get the correct value back. 

 

Today =
IF(
MAX(Processed[Report Date]),
"Today",
IF
(Processed[Report Date] < MAX(Processed[Report Date]),
Processed[Report Date]&""
))
 
UnknownValue_0-1644858121124.png

 

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.