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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
SwissCake
Frequent Visitor

Default Date slicer latest date - skip weekends

Hi all

 

I would like to create a default date slicer "latest" which updates every time new data is loaded to the latest date. Note this is an End of Day Report, meaning the latest date is always TODAY()-1, except on Monday it should be Friday

My code: 

Selected Date = SWITCH(TRUE(),[Date] = TODAY()-1,"Latest", FORMAT([Date], "dd/mm/yyyy"))
 
Problem: works well, except on Monday it does not update because no data is loaded on the weekends for my report (as no data exists on non business days)and hence no "latest" date exists with the above formula.

 

I was wondering if it were possible to modify this expresission that on Monday, last Friday is considered the latest date.

 

I have a holistic date table which includes day name, dummy for weekdays and weekends etc...

 

Many thanks in advance for your help!

 

Best SwissCake

2 ACCEPTED SOLUTIONS
Idrissshatila
Super User
Super User

Hello @SwissCake ,

check this link for instructions on how to set a slicer to default latest date https://www.youtube.com/watch?v=JlVHsZUk1nc

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




View solution in original post

thank you very much for posting the video - that goes a bit beyond what i require. 

 

I think I modified my code and it works now -  In addition to this code I filtered my calender table to exclude weekends.

 

modified code

 

Selected Date = SWITCH(TRUE(),[Date] = MAX(Calender[Date]),"Latest", FORMAT([Date], "dd/mm/yyyy"))
 

View solution in original post

2 REPLIES 2
Idrissshatila
Super User
Super User

Hello @SwissCake ,

check this link for instructions on how to set a slicer to default latest date https://www.youtube.com/watch?v=JlVHsZUk1nc

 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Follow me on Linkedin



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




thank you very much for posting the video - that goes a bit beyond what i require. 

 

I think I modified my code and it works now -  In addition to this code I filtered my calender table to exclude weekends.

 

modified code

 

Selected Date = SWITCH(TRUE(),[Date] = MAX(Calender[Date]),"Latest", FORMAT([Date], "dd/mm/yyyy"))
 

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code FABINSIDER for a $400 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Solution Authors