Forum Discussion

Djam75's avatar
Djam75
Regular Visitor
2 years ago
Solved

Visuel segment : how to define start andend date

 

Hello,

I have simplified the data and the BI report to better explain my issue.

I have a Power BI report that includes a "segment" visual with a date range filter (between startDate and endDate) for colonne OrderDate . The table displays the data based on this date filter.

The data is updated daily with new entries for the current day.

 

However, when I deploy this report to the Power BI server and view it, the dates (startDate and endDate) remain as those selected in Power BI Desktop during the report's design.

 

My issue is the following:  when i displauy report on BI serevr  (after new data has been added to the "orders" table), the report still shows the dates selected in Power BI Desktop at the time of deployment.

 

What I would like is that, by default, when the report is viewed on the server:

  • startDate should be the first day of the current year (01/01/2024),- (for my exemple i dont have a data)
  • endDate should be the day before the current date (currnt day, is a day when i display a report).

Then, if I change the dates, the filter should continue to apply to the "OrderDate" column.

 

 

Thank you in advance for your help.

 

Djam75

PS-I am attaching a simplified version of the Power BI report, saved with endDate set to 10/09/2024.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Thanks for the reply from parry2k.

     

    Hi Djam75 ,

     

    Based on the description of your problem, I achieved what you need by creating a new table as a field for the slicer and changing a setting, here are the exact steps I took:

    1.Create a new table:

    NewTable = CALENDAR(DATE(YEAR(TODAY()), 1, 1),TODAY() - 1)
    

     

    2.Create the relationship:

     

    3.Create the visuals:

    4.Then go to File>Options and settings>Options. Under Current File, select Report settings. Click on the box "Don’t allow end users to save filters on this file in the Power BI service".

    This ensures that every time a report is opened, it will display the default filters set by the report creator.

     

    Best Regards,
    Zhu
    Community Support Team

     

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

3 Replies

    • Djam75's avatar
      Djam75
      Regular Visitor

      Thank you, Parry2k, for your suggestion. Sorry, it (relative date) doesn't work for us , as we want to keep the date filter between (startDate, endDate).

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks for the reply from parry2k.

     

    Hi Djam75 ,

     

    Based on the description of your problem, I achieved what you need by creating a new table as a field for the slicer and changing a setting, here are the exact steps I took:

    1.Create a new table:

    NewTable = CALENDAR(DATE(YEAR(TODAY()), 1, 1),TODAY() - 1)
    

     

    2.Create the relationship:

     

    3.Create the visuals:

    4.Then go to File>Options and settings>Options. Under Current File, select Report settings. Click on the box "Don’t allow end users to save filters on this file in the Power BI service".

    This ensures that every time a report is opened, it will display the default filters set by the report creator.

     

    Best Regards,
    Zhu
    Community Support Team

     

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