Forum Discussion
Create multiple slicers from two separate tables
- 6 years ago
Hi, Anonymous
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
TableA:
TableB:
You may create three calculated tables and two measures as below.
Calculated table: Slicer Name = DISTINCT(UNION(DISTINCT(TableA[Name]),DISTINCT(TableB[Name]))) Slicer Class = DISTINCT(UNION(DISTINCT(TableA[Class]),DISTINCT(TableB[Class]))) Slicer Grade = DISTINCT(UNION(DISTINCT(TableA[Grade]),DISTINCT(TableB[Grade]))) Measure: Visual ControlA = var _name = SELECTEDVALUE(TableA[Name]) var _class = SELECTEDVALUE(TableA[Class]) var _grade = SELECTEDVALUE(TableA[Grade]) return IF( _name in DISTINCT('Slicer Name'[Name])&& _class in DISTINCT('Slicer Class'[Class])&& _grade in DISTINCT('Slicer Grade'[Grade]), 1,0 ) Visual ControlB = var _name = SELECTEDVALUE(TableB[Name]) var _class = SELECTEDVALUE(TableB[Class]) var _grade = SELECTEDVALUE(TableB[Grade]) return IF( _name in DISTINCT('Slicer Name'[Name])&& _class in DISTINCT('Slicer Class'[Class])&& _grade in DISTINCT('Slicer Grade'[Grade]), 1,0 )Finally you need to put the 'Visual ControlA', 'Visual ControlB' in the corresponding visual level filter and use the 'Name', 'Class', 'Grade' column from 'Slicer Name', 'Slicer Class', 'Grade' table to filter the result.
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
My question was, suppose you have score columns in first table also and in both the table you have 'Year' column as well. Now you want to take any score column from any table and compare them based on different time basis. Like you will have two slicers to control different time period and one column chart suppose where taken two 'score' columns (sum of scores) will appear.