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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
naelske_cronos
Helper III
Helper III

hierarchical date slicer - default date today

Hello,

 

I have a hierarchical date slicer with year, month and a calculated column which will give the current day as a string if the date is equal to today.

Capture.PNG

Capture1.PNG

This is the code for me calculated column '_Huidige_dag' or current day.

 

 

_Huidige_dag = 
IF (
    Datums[Date] <> TODAY (),
    CONVERT ( Datums[DagVanMaandNummer], STRING ),
    "huidige dag"
)

Capture2.PNG

 

The result is working well and changes the date in the same month but when it comes to the end of the month it does not change like in the example above. The current day is after the 30th of November but it should be in the month December the 7th.

 

Thanks!

Kind regards

1 ACCEPTED SOLUTION

Consider using the Filter Pane instead. It offers relative date filters.

View solution in original post

3 REPLIES 3
lbendlin
Super User
Super User

Here is the general pattern:

 

- create a string representation of your date column, replace the latest date with a string "Latest"
- sort that new column by the original date column
- add a slicer or visual/page/report level filter
- set the filter to "Latest"
- publish the pbix to the workspace/app

Hello,

 

I understand what you're trying to say and this will indeed work but when I do that I don't have a hierachical slicer. What I did works partially, it's just that when it comes to a new month that it does not jump to a new month like shown in my first image. When it was the 1th of December, "Latest Date" was shown after the 30th in the month November.

 

It is the intention for the user to see data for the latest date automatically or a date that they can choose from using the hierarchical date slicer which is easier to pick a date. If I use your example, they need to scroll down to search a specific date (but a solution could be to use the search tool now that it is a string format).

 

I just want to know if it is possible with my example and if I did something wrong causing the bug that I have right now.

 

 

Kind regards

Consider using the Filter Pane instead. It offers relative date filters.

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.

Top Solution Authors