Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

Creating dynamic time periods that update automatically

Dear Power BI- Community,

 

I am struggeling with following task:

 

I would like to (or more or less have to) create a dynamic time slicer, that only shows the past half year and will continue to do so. So, of today the time period shown will be 4th of Jan - 4th of July, tomorrow this shall be updated to 5th of Jan to 5th of July and so on...

 

How can I go about this?

Any hint or help will be greatly appreciated!

 

Thanks a lot :-) 

  • tex628's avatar
    tex628
    7 years ago

    The table expression is evaluated each time the report is updated which means that the TODAY() syntax will return the the current day when the report is updated. This means that if you want this to return the correct range you need to have the report on a scheduled refresh once every day. Apart from that there shouldent be anything else to worry about!

3 Replies

  • tex628's avatar
    tex628
    Community Champion

    I would recommend creating a calendar that only holds that specific interval, 

    TABLE = CALENDAR(DATE(YEAR(TODAY()) , MONTH(TODAY())-6 , DAY(TODAY())) , TODAY())
    Add a relationship and the use it with a slicer.
    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for the hint.

      So tomorrow with the data refresh, this table will be automatically updated, too? Or are there further steps required?

      • tex628's avatar
        tex628
        Community Champion

        The table expression is evaluated each time the report is updated which means that the TODAY() syntax will return the the current day when the report is updated. This means that if you want this to return the correct range you need to have the report on a scheduled refresh once every day. Apart from that there shouldent be anything else to worry about!