Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Using relative date slicer to get last 3 full weeks

Hi,

 

Hope anyone found a solution to this.

 

We are trying to set a dynamic period for the last 3 full weeks. In the example to the left this would be a period from 3-9-2018 to 23-9-2018. This to compare the current (running) week to the last 2 weeks.  Our weeks start on monday but this could also be applied to a week starting on sunday.

 

Using the relative date slicer we can come up to two period's based on calendar weeks or just weeks. 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

The result for a relative date slicer on Weeks returns:

From today to 21 days back. week 35 is incomplete

 

 

The result for a relative date slicer on Calendar Weeks returns:

The last 3 weeks but without the current week. Week 38 is missing

 

A solution would be to create a new column with the last 3 weeks marked but if you open this solution another request will be the last 2 or 4 weeks, generating multiple columns. 

 

Would be ideal to get a relative date slicer with a full including current indicator to get the current week/month/year and also X week/month/years back.

  • Hi Anonymous,

     

    Based on my test, Using relative date slicer cannot achieve your goal. However we can create a measure to work asourd.

     

    Measure = IF(MAX('Table'[week])=WEEKNUM(TODAY()) || MAX('Table'[week])=WEEKNUM(TODAY()) -1||MAX('Table'[week])=WEEKNUM(TODAY()) -2,1,0)

    Then create a visual and filter the visual by the measure.

     

     

    For more details, please check the pbix as attached.

     

    Regards,

    Frank