Forum Discussion
Creating a rolling 6 week date range for use in graphs
- 10 years ago
mur2za instead of putting the measures you used into the graph, use them in either the page level filter or the graph visual filter. Then for your axis put in a date column. The measures should filter the axis to what you want.
The other option is to create a custom column as follows:
Last 42 days = IF(AND(DateKey[Date]>=[Today]-42,DateKey[Date]<=[Today]),1,0)
[Today] is a measure : Today = DATE(YEAR(NOW()),MONTH(NOW()),DAY(NOW()))
Enter the last 42 days column in the page level or visual level filter and then select 1. Enter a date column in the axis of the graph. This will maintain a rolling 42 day axis.
Thanks,
Giles
Sorry guys, the above solution worked fine on a subset of my sales data. However, when I tried to create the Last42Days measure in my Calendar file in my master .pbix file (which contains my entire sales data from the start of 2015 through present), it gives me an error "A single value for column'WeekEnding' in table 'BasicUSCalendar' cannot be determined".
This same measure worked fine in the same calendar table in the subset file - any idea why it throws this error in the master file?
- mur2za10 years agoFrequent Visitor
Never mind - I was creating it as a measure instead of a column! It's working now, thakns again for the help guys!