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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

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
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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