Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Power BI Slicer - Between Dates don't get the latest date

Hello everybody!!

I need some help with the date slicer on Power BI Desktop.


When I create my Dashboard, I put an slicer between two dates, that are my first and last date based on my Calendar table (it's based on my first ticket creation date, on my tickets table, and "today" function). After, I publish it on my Report Server, set the schedule refresh, everything is okay. But on the next day, when I'll check the Dashboard, after the refresh, the last date wasn't the most recent date (or today, in that case), but the date when I published the Dashboard, so the viewer needs to slide the filter to the right to get the actual date, or click on the "clean filters" button.

 

 

 

That's the example of date filter that I'm using. It was published on Jul,11 (it's on Brazilian format), and the second image, is the today refresh. Note that the first date changes too, because the Dashboard was published with data from Apr, 11 2019 to Jul, 11 2024, so at the refresh, my source data was only after Jan, 2 2023


There's some solution based on this? I've the latest release of Power BI Desktop and Report Server, but I didn't find any settings to do that. 

I've searched in a bunch of topics here, on Stack Overflow, Reddit, but didn't find anything specific for that. 

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi,Anonymous .I am glad to help you.

    According to your description, you want the date slicer of type between in desktop to always show the latest date (today).
    i.e. every time a user opens a report (Power BI Service), the slicer displays and shows the latest date.


    Unfortunately, there is no direct way to set the default value of the slicer in power BI. Fortunately, however, you can indirectly achieve this effect by creating a measure or caculate to control the display.

    1. Create a measure to set the default filter state for the visual filter of the slicer. When the user opens the report, the data in the table will be displayed as the default value of “Today” data.


    2. Create a new calculate column and measure combination, the date of the date marked out, and then set the slicer to select “Today” (at this time is already a text type calculate column), through the measure filtered out the latest ( Today) data through the measure.
    If you use this way, you can no longer use the between type, because at the moment the newly created slicer field is of text type.


    Here is my test, hope it helps.
    suggestion 1:create measure, control the default options of visual by the value of measure.

     

    M_getdate: always get the latest date on the slicer

     

     

    M_notFilter: determine that the slicer does not consider the latest date data to be displayed by default when it is selected (this measure is noticeable in the case of drop-down types or multi-select type slicers, but not in the case of between types).


    M_filter:Default slicer filtering when slicer is judged to have a filter.

     


    Combine the two cases in a measure, through the measure to filter, of course, you can directly combine the three measure into a measure, I here in order to explain more detailed to take a step-by-step approach.

     

    Note that the slicer is now filtered by measure: M_test, not directly by slicer, which has the effect of passing date values, so you'll need to create a separate date table specifically for the slicer to use.

    sugestion2. by creating a new calculated column (text type) as a filter field for the new slicer.


    Mark the current date=Now() date row individually, and let the slicer select that row of data, publish to the service, and you need to set the slicer value modified by the user in the service will not be saved in desktop, so that every time the user re-opens the report, the slicer and the corresponding visual will always remain selected by default (that is, the state when you last published the report). (that is, the last time you published the report)



    Ensure that when a user opens a report on a service, the slicer is always in the state it was in when the creator last PUBLISHED the report.

    Luckily, I also found a similar resolved issue, so I hope that helps.
    Other users here have offered similar
    suggestions.
    URL:
    Solved: Set default date to today on date slicer - Microsoft Fabric Community

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

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

     

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi,Anonymous .I am glad to help you.

    According to your description, you want the date slicer of type between in desktop to always show the latest date (today).
    i.e. every time a user opens a report (Power BI Service), the slicer displays and shows the latest date.


    Unfortunately, there is no direct way to set the default value of the slicer in power BI. Fortunately, however, you can indirectly achieve this effect by creating a measure or caculate to control the display.

    1. Create a measure to set the default filter state for the visual filter of the slicer. When the user opens the report, the data in the table will be displayed as the default value of “Today” data.


    2. Create a new calculate column and measure combination, the date of the date marked out, and then set the slicer to select “Today” (at this time is already a text type calculate column), through the measure filtered out the latest ( Today) data through the measure.
    If you use this way, you can no longer use the between type, because at the moment the newly created slicer field is of text type.


    Here is my test, hope it helps.
    suggestion 1:create measure, control the default options of visual by the value of measure.

     

    M_getdate: always get the latest date on the slicer

     

     

    M_notFilter: determine that the slicer does not consider the latest date data to be displayed by default when it is selected (this measure is noticeable in the case of drop-down types or multi-select type slicers, but not in the case of between types).


    M_filter:Default slicer filtering when slicer is judged to have a filter.

     


    Combine the two cases in a measure, through the measure to filter, of course, you can directly combine the three measure into a measure, I here in order to explain more detailed to take a step-by-step approach.

     

    Note that the slicer is now filtered by measure: M_test, not directly by slicer, which has the effect of passing date values, so you'll need to create a separate date table specifically for the slicer to use.

    sugestion2. by creating a new calculated column (text type) as a filter field for the new slicer.


    Mark the current date=Now() date row individually, and let the slicer select that row of data, publish to the service, and you need to set the slicer value modified by the user in the service will not be saved in desktop, so that every time the user re-opens the report, the slicer and the corresponding visual will always remain selected by default (that is, the state when you last published the report). (that is, the last time you published the report)



    Ensure that when a user opens a report on a service, the slicer is always in the state it was in when the creator last PUBLISHED the report.

    Luckily, I also found a similar resolved issue, so I hope that helps.
    Other users here have offered similar
    suggestions.
    URL:
    Solved: Set default date to today on date slicer - Microsoft Fabric Community

    I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

    Best Regards,

    Carson Jian,

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