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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

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
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.