Forum Discussion
Slicer reverse selection in chart
- 9 years ago
Hi afaque03,
In your scenario, please create another table (Table2) contains the column Year value, assume the sample data like below:
Make sure there is no relationship between these two tables.
Then create a measure within Table2 like below:
Select Value = IF(HASONEVALUE(Table2[Year]),VALUES('Table2'[Year]),BLANK())
Create a measure in Table1 like below:
Total = CALCULATE(SUM(Table1[Sales]),FILTER('Table1','Table1'[Year]<>'Table2'[Select Value]))
Then place the Year column from Table2 in a slicer visual, Place measure 'Total' as line chart value. See:
Best Regards,
Qiuyun Yu
v-qiuyu-msftThanx a lot it worked for the sum, Now I have one more case in that case that filter should also work for product name. As currently in this situation the DAX function you gave me works only for amount as it has sum() and calculate(). How can I list those products only which are selected in that slicer.
So in this situation when I click on year 2014 it should list all the data of 2013 and 2012 in line chart and there is one more chart which is a slicer so the slicer contains the product name. When I select an year from the year slicer for example 2012 than my product slicer should display all the products of 2012 and line chart to display the amount of 2013 and 2014. As in current situation the product name is from Table1 and year slicer is of Table2 so as there is no relationship between these two tables therefore when I click on year slicer of that of Table2 the line chart works fine but there is no changes in the product name list slicer. Can you suggest some DAX function for product name as well
Did it worked for anyone?
Thanks,
Piyush