Forum Discussion
Dynamic date charts (for week number)
If your week number is being derived off some sort of date field, what you can do is put the date field in the visual filter section and use the relative date filtering to say you're only wanting data within the last 42 days. Not sure how it would work if it isn't, perhaps make some sort of calculated column that has a week number running continuously (so that it doesn't reset year on year), then look up the largest value (to get the current week number), and do some DAX to take that off of your new column, add six, then filter on positive values?
- afk8 years ago
Advocate II
Hi jthomson,
Thanks for your suggestion. Yes, my week number is derived from a date field so this suggestion works easily. However, this only works well if the data is constantly up to date.
Currently, my data is only dated up to mid Jan. Is there a way for the charts to show the latest 6 weeks from the latest date in the data? 'MAX(date) - 6 weeks' for example.
- Anonymous8 years agoNot applicable
HI afk,
In my opinion, I'd like to suggest your take a look at relative date slicer. I think it may suitable for your requirement.
Use a relative date slicer and filter in Power BI Desktop
Regards,
Xiaoxin Sheng
- afk8 years ago
Advocate II
Hi Anonymous,
This is similar to the previous suggestion, but the same issue occurs. It takes the latest [#] weeks from today's date. But if the data is not up-to-date, then it doesn't work so well. In my case, the latest data date is 16/01/2018, and if I choose to show the last 6 weeks, it only shows me 3 weeks. If i choose to show the last 1 week, it appears as blank as i don't have any data for the past week.
Any suggestions for this?