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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
PBIfanatic
Helper V
Helper V

Same column, multiple filters

Hi,

Is it possible to create multiple filters from the same column and use the input from both the filters to feed the chart. So its effectively the same column in the axis of the chart but the selection is coming from 2 filters. I can use interaction to isolate the selections from each filter. thanks 

1 ACCEPTED SOLUTION

Hi @PBIfanatic ,

We can create a measure to meet your requirement.

The measure calculate the sum total between [Slicer_value 1] and [Slicer_value 2].

 

Slicervalue total = 
var _selected1 = VALUES('Slicer 1'[Group])
var _selected2 = VALUES('Slicer 2'[Group])
var _value1 = CALCULATE(SUM('Table'[value]),FILTER('Table', 'Table'[Group] in _selected1))
var _value2 = CALCULATE(SUM('Table'[value]),FILTER('Table', 'Table'[Group] in _selected2))
return
_value1 + _value2

 

same1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

9 REPLIES 9
v-zhenbw-msft
Community Support
Community Support

Hi @PBIfanatic ,

 

We can create two tables and two measures to meet your requirement.

We create a sample, and want to see both selections have performed over time.

 

1. Create two tables that contain the distinct field you want to add a slicer. For the example, we want to add the GROUP field in slicer, so we need to create two Group tables.

 

Slicer 1 = DISTINCT('Table'[Group])
Slicer 2 = DISTINCT('Table'[Group])

 

same2.jpg        same1.jpg

 

2. Then we create a line chart based on two measures.

 

Slicer_value 1 = 
var _selected = VALUES('Slicer 1'[Group])
var _value = CALCULATE(SUM('Table'[value]),FILTER('Table', 'Table'[Group] in _selected))
return
_value
Slicer_value 2 = 
var _selected = VALUES('Slicer 2'[Group])
var _value = CALCULATE(SUM('Table'[value]),FILTER('Table','Table'[Group] in _selected))
return
_value

 

same3.jpg

 

same4.jpg

 

If it doesn’t meet your requirement, could you please provide a mockup sample based on fake data?

It will be helpful if you can show us the exact expected result based on the tables.

 

Please upload your files to OneDrive For Business and share the link here. Please don't contain any Confidential Information or Real data in your reply.

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks @v-zhenbw-msft , thats awesome.

Its very close to what I need, is there a way to show the selected dimensions in the chart?

If I have a single selection from Slicer 1 and I select 3 from Slicer 2, is it possible to show all these 4 selections as separate lines in the chart?

Hi @PBIfanatic ,

We can create a measure to meet your requirement.

The measure calculate the sum total between [Slicer_value 1] and [Slicer_value 2].

 

Slicervalue total = 
var _selected1 = VALUES('Slicer 1'[Group])
var _selected2 = VALUES('Slicer 2'[Group])
var _value1 = CALCULATE(SUM('Table'[value]),FILTER('Table', 'Table'[Group] in _selected1))
var _value2 = CALCULATE(SUM('Table'[value]),FILTER('Table', 'Table'[Group] in _selected2))
return
_value1 + _value2

 

same1.jpg

 

If it doesn’t meet your requirement, could you please show the exact expected result based on the table that we have shared?

BTW, pbix as attached.

 

Best regards,

 

Community Support Team _ zhenbw

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

HI, I have tried this approach and it worked, But
When no values are selected , its actually shows double the actual output. 
like return value1+value2. Could you please suggest someting for that.

For slicer 1 and 2 i am using number values.

Hey,I have multiple slicers from multiple columns.Can this work for the same?

 

parry2k
Super User
Super User

@PBIfanatic why would you do that, why not one slicer with multiple selections?

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  Its a requirement to show it in 2 filters...to have one selection as the core product and then other ones as a comparison.

Is this possible ?

@PBIfanatic yes you can surely have multiple slicers from the same column.

 

I would  Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!

Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k  thanks!

How can I show both the selections in a single chart, lets say a line chart. I need to have both of the selections to show in legend. I have a measure and a time dimension as well, so this needs to fit in the legend and I need to see how both selections have performed over time.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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