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

How to Create Slicer Using Name and Not ID

I have two tables - a Support Ticket table and an Customer table.  The Customer table has ID as a key and name as a column.  The Support Ticket table has ticket # as a key and Customer ID as a column.  I have a relationship between the two tables using the ID.

 

I want to have a slicer with customer names in it so I can report on that customer's support tickets.  I can't figure out how to use the customer name in order to reference the support ticket information via the ID.  I can put the support ticket ID field into the slicer and it works.  If I put the customer name into the slicer I get all the customer names in the customer table.  That's not what I want.

1 ACCEPTED SOLUTION
mow700
Resolver I
Resolver I

Consider adding a calculated column to your support ticket table to contain the related customer name like:

Customer Name = RELATED('CustomerTable'[Customer Name])

Then use this column in your slicer visual.

View solution in original post

6 REPLIES 6
mow700
Resolver I
Resolver I

Consider adding a calculated column to your support ticket table to contain the related customer name like:

Customer Name = RELATED('CustomerTable'[Customer Name])

Then use this column in your slicer visual.

Thanks @mow700.  Just what I needed.

 

@GilbertQ, that actually helps me with another issue I have.  Thanks.

v-ljerr-msft
Employee
Employee

Hi @mhambalek,



I have two tables - a Support Ticket table and an Customer table.  The Customer table has ID as a key and name as a column.  The Support Ticket table has ticket # as a key and Customer ID as a column.  I have a relationship between the two tables using the ID.


As long as the relationship between the Customer table and Support Ticket table is properly set, you should be able to simply use the Customer Name from your Customer Table as a slicer, and then when you select Customer Name it should work as expected.

 

Could you share a sample pbix file(with just some sample/mock data) which can reproduce the issue, so that we can help further investigate on it? You can upload it to OneDrive or Dropbox and post the link here. Do mask sensitive data before uploading.Smiley Happy

 

Regards

GilbertQ
Super User
Super User

Hi @mhambalek

 

Which direction is your relationship in your data?

 

I would imagine that as long as you are using the Customer Name from your Customer Table in your slicer, then when you click on a Customer Name it should work as expected.

 

If it does not are you able to provide a sample of your data?





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

Proud to be a Super User!







Power BI Blog

Hi @GilbertQ,

 

The relationship is working.  Clicking a customer that exists in the tickets table selects the right data.  The problem is the slicer shows ALL customers in the customer table and not just the ones that exist in the tickets table.  There are over 4000 customers showing in the slicer.  I'd like it to only show the ~80 customers that actually have tickets.

 

The relationship is many to one, Support Tickets to Customer and single direction.

 

Hi @mhambalek

 

You could then use this blog post I did, in which I demonstrate how to only create a calculated table that has got the values in your data. Which is what I think you are looking for.

 

https://www.fourmoo.com/2017/01/24/power-bi-how-to-filter-slicers-dynamically/





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

Proud to be a Super User!







Power BI Blog

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.