Forum Discussion
Dynamic Dates for 13-Month Trend
- 1 year ago
Hi,
I have solved a similar question in the attached PBI file.
abd8,
The calculated table you created in step 5 is unable to recognize user-specified filters in Report view (e.g., slicers). See link below for a dynamic solution:
https://www.sqlbi.com/articles/show-previous-6-months-of-data-from-single-slicer-selection/
This is very helpful. However, when I try to implement that code, I'm getting this error:
USERELATIONSHIP function can only use the two columns references participating in relationship.
I did tweak it slightly for my use case, so that may be what's causing it:
- DataInsights1 year agoSuper User
abd8,
Verify the columns in the relationship between 'Previous Date' and 'Calendar'. The columns in the relationship should be used in the USERELATIONSHIP function.
- abd81 year agoRegular Visitor
Ok, I set up the relationship and that formala is now working. How do I now set up my slicer and x-axis to ensure a proper 13-month lookback on the x-axis based on the slicer selection?
- DataInsights1 year agoSuper User
abd8,
The slicer would be based on a 'Calendar' field such as Year Month (you should be able to control all visuals with this slicer). The x-axis would use a 'Previous Date' field.