Forum Discussion
robertsarza
5 years agoRegular Visitor
Comparing same column from same table but filtered differently in visuals using slicers and interact
Hi Everyone, Asking for help and suggestion about comparing same column from same table but filtered differently in visuals using slicers and interaction. What I did was I created 2 set of sl...
- 5 years ago
Hi robertsarza ,
You need to create another 2 slicer tables first;
Then create a dimension table as below:
Finally create 4 measures as below:
salary1 = IF(ISFILTERED('Slicer 1'[age]),CALCULATE(MAX('Table'[salary]),FILTER('Table','Table'[age]=SELECTEDVALUE('Slicer 1'[age]))),MAX('Table'[salary]))salary2 = IF(ISFILTERED('Slicer 2'[age]),CALCULATE(MAX('Table'[salary]),FILTER('Table','Table'[age]=SELECTEDVALUE('Slicer 2'[age]))),MAX('Table'[salary]))Sliced value = SWITCH(SELECTEDVALUE('Dimension table'[slicers]), "slicer1",'Slicer 1'[salary1], "slicer2",'Slicer 2'[salary2],BLANK())Rankx = RANKX(ALL('Dimension table'),'Dimension table'[Sliced value],,DESC,Dense)And you will see:
For the related .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
v-kelly-msft
5 years agoCommunity Support
Hi robertsarza ,
You need to create another 2 slicer tables first;
Then create a dimension table as below:
Finally create 4 measures as below:
salary1 = IF(ISFILTERED('Slicer 1'[age]),CALCULATE(MAX('Table'[salary]),FILTER('Table','Table'[age]=SELECTEDVALUE('Slicer 1'[age]))),MAX('Table'[salary]))salary2 = IF(ISFILTERED('Slicer 2'[age]),CALCULATE(MAX('Table'[salary]),FILTER('Table','Table'[age]=SELECTEDVALUE('Slicer 2'[age]))),MAX('Table'[salary]))Sliced value =
SWITCH(SELECTEDVALUE('Dimension table'[slicers]),
"slicer1",'Slicer 1'[salary1],
"slicer2",'Slicer 2'[salary2],BLANK())Rankx = RANKX(ALL('Dimension table'),'Dimension table'[Sliced value],,DESC,Dense)
And you will see:
For the related .pbix file,pls see attached.
Best Regards,
Kelly
Did I answer your question? Mark my post as a solution!