cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
preetparmar Frequent Visitor
Frequent Visitor

Two slicer on same column

Before someone tells me that I can select two values in a slicer and that does the trick. I know that but that is not what i want here.

The idea is to have 1 v 1 comparison. So I need two slicer on the same column where the user can select 1 product from the first slicer and another product from the second slicer.

The problem which I am facing is that any graph created tries to filter both products and results in blank as Slicer 1 AND Slicer 2 is Null (which is obvious). I am thinking something like Slicer 1 OR Slicer 2 might do the trick but am open to any ideas you have. 

 

Thanks

 

 

6 REPLIES 6
zoloturu
Advisor

Re: Two slicer on same column

@preetparmar,

 

I know how to help you. You need a feature called 'Edit interactions' - https://docs.microsoft.com/en-us/power-bi/service-reports-visual-interactions

 

For instance, you have one two slicers and two tables like below:

 

edit interactions 1.JPGedit interactions 1

Then select the first slicer and go to Format -> 'Edit interactions' and disable filter on a second slicer and second table.

Then click on the first table and do completely the same.

 

After that click on the second slicer and disable filter on a first slicer and first table. Do completely the same for the second table.

 

As a result, you be able to filter both slicers separately like below:

 

edit interactions 2.JPGedit interactions 2

Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!

 

preetparmar Frequent Visitor
Frequent Visitor

Re: Two slicer on same column

Hey Ruslan

Thanks for the quick reply. Yes the edit interaction does that but the main goal is to have a 1 v 1 comparison, for eg a Pie chart for the two months (in your example). 

Edit Interation works when there are two seperate graphs but not when there is one graph.

 

The result -> compare the two Partners and generate and 1 v 1 comparison.

Image 7.png

 

I hope this helps
Thanks

Super User
Super User

Re: Two slicer on same column

Create a measure that calculates based upon the MAX of your column and another that calculates based upon the MIN of your column. Use those measures in your visuals.

 

Really tough without sample data. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490


I have book! Learn Power BI from Packt


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

Proud to be a Datanaut!

Highlighted
zoloturu
Advisor

Re: Two slicer on same column

Hi @preetparmar,

 

It can be done as well. See a screenshot and details how to achieve that below:

 

MonthFilter 1.pngmonth filter

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

1. Create a calculated table using a formula:

 

 

MonthFilter1 = DISTINCT(VALUES(Table1[Month]))

where

 

- Table1 is your table name

- [Month] is your column of table Table1 to be used as a filter

- MonthFilter1 is your name for this calculated table, can be free text

 

Some examples of what is a calculated table and how to create ithttps://www.youtube.com/watch?v=aKX1E3krl4I

 

2. Add a calculated measure to the table MonthFilter1:

 

 

MonthFilter1 Value = SELECTEDVALUE(MonthFilter1[Month])

 

Examples - https://www.youtube.com/watch?v=yn2bXVQJLx8

 

3. Create a second calculated table MonthFilter2 and measure MonthFilter2 Value in it (replace all 1 digit with 2 in formulas, except table Table1 name)

 

4. Create a calculated measure in Table1:

 

 

SalesMonth1 = SUMX(FILTER(Table1,Table1[Month]=MonthFilter1[MonthFilter1 Value]),Table1[Sales 2017])

 

Where

- SalesMonth1 is a name of your measure

- Table1 is a name of your main table

- MonthFilter1 is a name of a first calculated table

[MonthFilter1 Value] is a name of a measure from a table MonthFilter1

[Sales 2017] is a name of your numeric field which you want to compare for different filters

 

5. Create a similar measure SalesMonth2 in the same table Table1 (replace all 1 digit with 2 in formulas, except table Table1 name)

 

Regards,
Ruslan
-------------------------------------------------------------------
Did I answer your question? Mark my post as a solution!

 

Raymo3u99 Frequent Visitor
Frequent Visitor

Re: Two slicer on same column

Hi @zoloturu ,

 

I'm trying something similar with data ranges instead of month and I don't get any results in the output measure. What could I be doing wrong?

 

Here are my formulas:

First table: LHS DateRange = CALCULATETABLE(VALUES('BilledRevenue'[EFF_START_DATE]))

Second Table RHS DateRange = CALCULATETABLE(VALUES('BilledRevenue'[EFF_START_DATE]))

 

First Measure: LHS Value = SELECTEDVALUE('LHS DateRange'[EFF_START_DATE].[Date])

Second Measure RHS Value = SELECTEDVALUE('RHS DateRange'[EFF_START_DATE].[Date])

 

Output1 Measure: CustomLHS = sumx(FILTER('BilledRevenue','BilledRevenue'[EFF_START_DATE].[Date]='LHS DateRange'[LHS Value]),'BilledRevenue'[Revenue])

 

Output2 Measure: CustomRHS = sumx(FILTER('BilledRevenue','BilledRevenue'[EFF_START_DATE].[Date]='RHS DateRange'[RHS Value]),'BilledRevenue'[Revenue])

 

I have created two slicers on LHS DateRange and RHS DateRange tables. No matter if I select a single date or a range of dates or multiple dates from the date slicers, I don't get any values in the CustomLHS or CustomRHS measures.

AnAnalyst Regular Visitor
Regular Visitor

Re: Two slicer on same column

@zoloturu Thank you for posting this. It helped with my question. 

Helpful resources

Announcements
New Ranks and Rank Icons in 2020

New Ranks and Rank Icons in 2020

Read the announcement for more information!

New Kudos Given Badges Coming

New Kudos Given Badges Coming

We're rolling out new Kudos Given badges. Find out how many Kudos you've given.

November 2019 Community Highlights

November 2019 Community Highlights

Get an overview of the events and great community content from November.

Power Platform World Tour

Power Platform World Tour

Find out where you can attend!

Top Solution Authors
Top Kudoed Authors (Last 30 Days)