Forum Discussion
One slicer for two visualizations
Hello,
I hope I will be able to explain my problem in a clear way:
I need to use just one slicer in order to select a year. The problem is that I would like to use this slicer for two different visualizations, one showing the data related to the year selected in the slicer and the other one, showing the same data for the previous year selected. I would like to personalize the second graph so that it shows the selected year minus one.
Is there any way of doing this? any DAX solution? THANK YOU!!!
2 Replies
- v-jiascu-msftMicrosoft Employee
Hi Carmen,
If you don't want to duplicate your tables, you have to create an independent date table, which means no relationships established to other tables. Then you can create two measure to filter whether the year is the current year or the previous year.
Can you share a sample? The DAX could depend on your data model. The solution could be like below.
measure = IF ( YEAR ( MIN ( 'table'[date] ) ) = MIN ( 'datetable'[year] ), 1, 0 )
Then hide these values "0".
Best Regards,
Dale
- v-jiascu-msftMicrosoft Employee