Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
robertsarza
Regular 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 slicers and 2 visualization. Using interaction, I set the 1st slicer to interact only with the 1st visual and the same for 2nd slicer to interact only to the 2nd visual. With this, I was able to have separate data from my visuals using slicer even if it is sourcing from same column and table. However, I want to compare the data that was appearing in the visuals. Does anyone here have idea to do it?

 

For reference:

 

Column NameUsing Slicer 1Using Slicer 2
A2030
Comparison I want2nd1st

 

 

 

1 ACCEPTED SOLUTION
v-kelly-msft
Community Support
Community Support

Hi  @robertsarza ,

 

You need to create another 2 slicer tables first;

Then create a dimension table as below:

v-kelly-msft_0-1608177809456.png

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:

v-kelly-msft_1-1608177994088.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

View solution in original post

1 REPLY 1
v-kelly-msft
Community Support
Community Support

Hi  @robertsarza ,

 

You need to create another 2 slicer tables first;

Then create a dimension table as below:

v-kelly-msft_0-1608177809456.png

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:

v-kelly-msft_1-1608177994088.png

For the related .pbix file,pls see attached.

 

Best Regards,
Kelly

Did I answer your question? Mark my post as a solution!

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.