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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Filter/slicer with 2 values on the same columns

Hi All,

 

I am trying to create slicer on same column whihc will have 2 types of data - please find below more details

 

Slicer.PNG

 

 

9 REPLIES 9
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

1.create a category table by entering data

18.png

2. create relationship

21.png

3. add "category" from Table2 in a slicer

20.png

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

Create a 2 column Table (Table2) with all fruits and cities in column 1 and Fruit or City in column 2.  Build a relationship from the Data column of Table1 to the Data column of Table2.  Create a slicer from column 2 of Table2.  To your visual, drag the Data column from Table1.  Write this measure

Measure1 = SUM(Table1[sales])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

Thanks for your response,

was tried with below approch,unfortunalty no luck .

 

as you mentioned created a new table with 2 columns , column1(Data) as is with main table and Column2 has only Fruits. when i use column2 from table 2 - i am getting all the fruits and nulls as well.

 

what i am looking in the slicer is - slicer should have only 2 values - Fruits and Cities - so that i can select either one of them or both.

Hi,

Column 2 of Table2 should have Fruit or City depending upon the entry in column A.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

Hi,

 

Thanks for your response here is the screen please have a look :

report.PNG

Hi,

In Data2 column of Table2, the entries should be Fruit, City, Fruit, City, City, Fruit, Fruit, City.  Create a slicer from this column.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Anonymous
Not applicable

 Hi,

 

Thanks for your update. 

please see below requirement : Slicer should have 2 values - 1. fruit 2. All

if i select fruit - it will pull only fruits and if i selct All it should have fruit and remaining values as well.

Hi @Anonymous 

To achieve this requirement:

Slicer should have 2 values - 1. fruit 2. All

if i select fruit - it will pull only fruits and if i selct All it should have fruit and remaining values as well.

 

Please follow steps below:

Based on my previous post, we have Table1 and Table2,

Besides all in my previous post,

create a new table without any relationship with other tables

Table3

24.png

 

Add [category_fruit] in the slicer

Create measures in Table1

isfiltered = ISFILTERED(Table3[category_fruit])

selected value = SELECTEDVALUE(Table3[category_fruit])

flag = IF([isfiltered]=TRUE(),IF([selected value]=MAX(Table2[category]),1,0),1)

Add [flag] in the visual level filter

22.png23.png

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

For All, you just leave all slicer boxes unchecked.  Simple.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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