Forum Discussion

sieed's avatar
sieed
Helper II
9 years ago
Solved

Creating Custom Date range

I am trying to create a custom date range that shows the last fifteen days no matter if there is data for that date in  my table or not. As long as it's in the last 15 days range, it should be shown on the graph. Here's my current graph: 



As you can see, it is not showing the last 15 days because I don't have any data pripr to March 1st. However, I need to display the last 15 day. I tried creatin a calculated column called Last15Days = toda() - date. However, this only displays dates which are in my data. So, for instance, Feb29th is not displayed although its in the last 15 days range. 

16 Replies

  • rocky09's avatar
    rocky09
    Solution Sage

    sieedwhy you deleted your previous thread. And you are posting this question as New (My Solution for that thread?)

    • sieed's avatar
      sieed
      Helper II

      I did not delete the thread. I got a message saying that my post is under review and it's been an hour since I got that message. That's why I created a new one.  I di dnot even se eyour reply. Can you please post it again? 

      • rocky09's avatar
        rocky09
        Solution Sage

        oh. I thought, you have deleted the thread.

         

        Try this:

         

         

         

         

  • I assume you do not have a dedicated Date table in your model. If not, add one and link it to your data. (Date tables are meant to solve this kind  of problems).

     

    The most basic date table has only one column and contains a set of contiguous dates.

     

    The quickest way to create one would be to add a calculated table to your model and use the CALENDARAUTO() function.

     

     

    • sieed's avatar
      sieed
      Helper II

      LaurentCouartouSo, do I have to jon this date table with my current table? How exactly does that work? 

      I have already created the datwe table, but am not sure hwo tojoin it with the job table I have because there is no common field. I can share my pbix file but I am not sure how to attach it. 

    • sieed's avatar
      sieed
      Helper II

      LaurentCouartou, I have created a Date Table with the past fifteen dates. Question is, how do I join it with my current table? There isno common field between the two...  nI can share my pbix file but I dont know how to attach it. 

      • rocky09's avatar
        rocky09
        Solution Sage

        date is the common field in both tables. you can create link.