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
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
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.