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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jsjcjsjc
Frequent Visitor

How can we ensure that the date in time slicer in Power BI is the latest date in database ?

Hi

for example. 1/31/2024 is changing, 

How can we ensure that the date in time slicer in Power BI is the latest date in database ? I don't wan to change it every month.

Thanks

jsjcjsjc_0-1721377193888.png

 

1 ACCEPTED SOLUTION

@jsjcjsjc , In that case, you can use below measure that you can use as a filter.

Measure =
VAR _date =
    CALCULATE ( MAX ( Sheet1[date range] ), ALL ( Sheet1[date range] ) )
RETURN
    IF ( MAX ( Sheet1[date range] ) <= EOMONTH ( _date, -1 ), 1, 0 )

 

Output ;-

Samarth_18_0-1721458275574.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @jsjcjsjc , I am afraid if I am missing something. However, if you have not added any explicit filter on the slicer it will take all the available data from the dataset that includes the latest dates.

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

yes, you are right. I missed  some  infomarion.

I hope to keep the date is The last day of the previous month of the new date in the database.

@jsjcjsjc , In that case, you can use below measure that you can use as a filter.

Measure =
VAR _date =
    CALCULATE ( MAX ( Sheet1[date range] ), ALL ( Sheet1[date range] ) )
RETURN
    IF ( MAX ( Sheet1[date range] ) <= EOMONTH ( _date, -1 ), 1, 0 )

 

Output ;-

Samarth_18_0-1721458275574.png

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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