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

Select latest date from the table in the slice

Hi Folks,

Thanks for addressing my query.

I need that my slicer will auto select the latest date from the drop down list. Is there any solutions??

Thanks,
Gaurav Jangra

1 ACCEPTED SOLUTION

@gauravjangra09 , That is where you need to have column like

Date Type = SWITCH(TRUE(),'Date'[Date]=max(Table[Date]),"Lastest Date" //Date equal to max of fact/table
,'Date'[Date]&"")

View solution in original post

4 REPLIES 4
v-rzhou-msft
Community Support
Community Support

Hi @Anonymous 

If you want to get the latest date by slicer, you can build a measure.

Due to I don't know your data model, I build a sample to have a test.

Measure:

M.Value = 
VAR _Value =
    SUM ( 'Table'[Value] )
VAR _LatestDate =
    MAXX ( ALL ( 'Table' ), 'Table'[Date] )
VAR _LatestValue =
    CALCULATE (
        SUM ( 'Table'[Value] ),
        FILTER ( 'Table', 'Table'[Date] = _LatestDate )
    )
RETURN
    IF ( ISFILTERED ( Sclier[Slicer] ), _LatestValue, _Value )

In table visual it will show all Dates as default and show the latest Date if you select the Slicer.

1.png

You can download the pbix file from this link: Select latest date from the table in the slicer

 

Best Regards,

Rico Zhou

 

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 , There no auto select option.

 

You have to use one of these tricks. Have a column like this and select the value. Sort this column on date column

 

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


Date Type = SWITCH(TRUE(),'Date'[Date]=Max('Table'[Date]),"Lastest Date"
,'Date'[Date]&"")

Anonymous
Not applicable

Hi @

Thanks for your reply.

This case is acceptable when data is updating regularly what should i do when i didn't have the latest data.
let suppose in my table i have latest record is for 13th September. then how i will address this.

Thanks,
Gaurav Jangra

@gauravjangra09 , That is where you need to have column like

Date Type = SWITCH(TRUE(),'Date'[Date]=max(Table[Date]),"Lastest Date" //Date equal to max of fact/table
,'Date'[Date]&"")

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.