Forum Discussion
Help!! year filter
- 6 years ago
The easiest way is to apply a filter to the specific visuals.
- Make sure the filter pane is visible. Select the View ribbon and Filter button if it isn't.
- Select the visual you want.
- For the date in the visual, select as shown below for the current year. Relative Date filtering is the key here.
- Repeat for the other visual, but change it to show "In the last", then 1, then "Calendar year." If you don't change it to "Calendar year" it will give you the last 12 months effectively.
BTW, the other solutions provided that talk about date tables and measures is really the way I would prefer to handle it, but applying visual filters can be the fastest, but it will only solve the problem for specific visuals and not provide the other advantages the measures will do once you have a real Date table in your model.
- Anonymous6 years ago
Hey Anonymous
This is what you are looking for: https://docs.microsoft.com/en-us/dax/sameperiodlastyear-function-dax
Alternatively, you can create another sliver and edit the interations so that one slicer interacts with one visual and the other with the other so that you can show two separate years of your choice according to the two slicers: https://docs.microsoft.com/en-us/power-bi/service-reports-visual-interactions
I have used both methods depending on the needed final result.
The easiest way is to apply a filter to the specific visuals.
- Make sure the filter pane is visible. Select the View ribbon and Filter button if it isn't.
- Select the visual you want.
- For the date in the visual, select as shown below for the current year. Relative Date filtering is the key here.
- Repeat for the other visual, but change it to show "In the last", then 1, then "Calendar year." If you don't change it to "Calendar year" it will give you the last 12 months effectively.
BTW, the other solutions provided that talk about date tables and measures is really the way I would prefer to handle it, but applying visual filters can be the fastest, but it will only solve the problem for specific visuals and not provide the other advantages the measures will do once you have a real Date table in your model.