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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Show latest date as default on slicer

Hi,

 

I want to show the latest dates as default in my slicer with all the previous dates,

 

Please let me know if there is a way to do it.

1 ACCEPTED SOLUTION
v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

a1.png

 

You may create a calculated column as below to have an option to show last 3 days.

Previous Days = 
IF(
    [Date]>=TODAY()-2&&
    [Date]<=TODAY(),
    "Last 3 Days",
    IF(
        [Date]<TODAY()-2,
        [Date]&""
    )
)

 

Today is 9/24/2020. Here is the result.

a2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

View solution in original post

3 REPLIES 3
GChristensen
New Member

i'm using the following formula

 

Date Type = SWITCH(TRUE(),'Date'[Date]=max(Table[Date]) ,"Latest Date"
,'Date'[Date]=TODAY()-1,"Yesterday"
,'Date'[Date]&"")

 

Which only gives me the current date. It removes all the other dates from being able to be selected. How do i get current date AND all the other available dates?

v-alq-msft
Community Support
Community Support

Hi, @Anonymous 

 

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Table:

a1.png

 

You may create a calculated column as below to have an option to show last 3 days.

Previous Days = 
IF(
    [Date]>=TODAY()-2&&
    [Date]<=TODAY(),
    "Last 3 Days",
    IF(
        [Date]<TODAY()-2,
        [Date]&""
    )
)

 

Today is 9/24/2020. Here is the result.

a2.png

 

Best Regards

Allan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

amitchandak
Super User
Super User

@Anonymous , Create a column in date table like this

 

Date Type = SWITCH(TRUE(),'Date'[Date]=TODAY(),"Today"
,'Date'[Date]=TODAY()-1,"Yesterday"
,'Date'[Date]&"")

 

or

 

Date Type = SWITCH(TRUE(),'Date'[Date]=TODAY(),"Today"
,'Date'[Date]&"")

 

or

 

Date Type = SWITCH(TRUE(),'Date'[Date]=max(Table[Date]) ,"Latest Date"
,'Date'[Date]=TODAY()-1,"Yesterday"
,'Date'[Date]&"")

 

sort this on date column and use this one as filter

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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