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
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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.