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
SR1
Helper I
Helper I

Include duplicates in slicer

I have a slicer that shows students name & the slicer removes duplicate names even if the students have different student ids.

Here is my table:

StudentIdStudentName
1Ann
2Bob
3Mila
4Mila
5Bob

I want the slicer to display names based on student ids. 

Appreciate any help.

 

6 REPLIES 6
mahenkj2
Solution Sage
Solution Sage

Hi @SR1 ,

One of way is to use both column in slicer, it will create hierarchy level as below:

mahenkj2_0-1653157033896.png

 

And also enable search in this slicer, so if user knows name, he just type few initial, and all duplicates are filtered on display for easy viewing and selection:

mahenkj2_1-1653157123848.png

 

Hope it helps.

ribisht17
Super User
Super User

@SR1 @v-yulgu-msft 

 

I was able to do it with some conditions,

Also, I understand that for the HR dashboard people tend to remember by names rather than ID and hence this requirement came to us as well because the end-user did not want to have IDs in the Slicer

 

ribisht17_0-1653152783580.png

 

Step 1

Rank Names C = RANKX( FILTER(ALL(Sheet6),Sheet6[Name]=EARLIER(Sheet6[Name])),Sheet6[ID],,ASC)
 /////Group the same names and Rank wrt ID no.
 
 
Step 2
Insert . C New = IF((Sheet6[Rank Names C])=2," ",IF((Sheet6[Rank Names C])=3,"  ",""))
///Insert Spaces to each rank, as per our experience we are assuming that there can be a maximum 3 exactly matching names but we can extend this to 5 or 10 whatever we want, but we don't recommend if there are too many common names say more than 10 
 
Step 3
FINAL NAME to be used in the Slicer
Final Name C = COMBINEVALUES(" ",(Sheet6[Name]),Sheet6[Insert . C New])
 
We can also use a similar approach to get the names as A_1,A_2,A_3.
Remember 1,2 and 3 here shows the 1st copy,2nd copy and 3rd copy , I am not taking about Student ID here,
If we want this approach then the Final Step 3 will be like
Final Name Number Approach = COMBINEVALUES(" ",(Sheet6[Name]),Sheet6[Rank Names C])
 
ribisht17_1-1653156434707.png

 

 
Actually, the second approach seems to be better since it shows the duplicate numbers as well without any limitations
 
Regards,
Ritesh
Mark my post as a solution if it helped you| Munde and Kudis (Ladies and Gentlemen) I like your Kudos!! !!
My YT Channel Dancing With Data !! Connect on Linkedin !!Power BI for Tableau Users 
 
 
v-yulgu-msft
Employee
Employee

Hi @SR1,

 

No. It is not possible to show duplicate names in slicer. A slicer always lists unique items. In this scenario, if there two slections for Mila, when we choose this value, which StudentId should be matched with it, it is not able to determine. 

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

You could create a calculated column to combine the two columns into a unique identifier with the following:

 

UniqueID =
COMBINEVALUES("-",Table[StudentName],Table[StudentId])

This will create a column with "Ann-1", "Bob-2", "Mila-3", "Mila-4", etc. You can then use this column in your slicer.

 

Hope this helps,

Parker

Hi @Anonymous . Thanks for replying! I don't want to display the ids in slicer. Is there any other way to do?

 

Anonymous
Not applicable

@SR1

 

Hmm I don't think I know a way to do that with a slicer. An alternative approach would be to simply use a table as a slicer. You could then show all names with respect to their ID's but a table obviously comes with some limitations. Hopefully someone else knows how to accomplish this!

 

-Parker

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.