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
razraz2020
New Member

Unique Values of Subset of Data using slicer

Looking to get unique values of sliced data compared to the entire data set.  Example below, 2 columns Restaurant & Menu.  If I had a slicer on Restaurant, I'd want to know what are the unique items.  So if McDonald's was selected, I would only want to see 'Fillet of Fish'.   If Wendy's was selected, I would see 'Chicken Sandwich' & 'Salad'.  How do accomplish what seems to be a very simple task.  

 

RestaurantMenu
McDonald'sCheesburger
McDonald'sFillet of Fish
McDonald'sHamburger
Burger KingCheesburger
Burger KingHamburger
Wendy'sHamburger
Wendy'sCheesburger
Wendy'sChicken Sandwich
Wendy'sSalad
1 ACCEPTED SOLUTION

@razraz2020 ,

 

Capture 1.PNGCapture.PNG

 

I've updated the file: Download PBIX 

 

Ricardo



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

Proud to be a Super User!



View solution in original post

9 REPLIES 9
camargos88
Community Champion
Community Champion

Hi @razraz2020 ,

 

Check this file: Download PBIX 

 

I just created a calculated column to count the distinct values in the table and filtered the table visual.

 

Ricardo



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

Proud to be a Super User!



Hi Ricardo,  @camargos88 

Thank you for the quick reply.  This solution answers the question as I phrased it, so kudos to you.  What I left out of my poorly written and over simplified example was that a Restaurant could have duplicate menu items.  Assume McDonalds had 'Fillet of Fish' multiple times or Wendy's had duplicate 'Chicken Sandwich'.   Although those are not unique to the Restaurant, they are unique to the rest of the data and would want the same results that you posted.  Thoughts?

 

 

Hi @razraz2020 ,

 

If you have duplicates for the same restaurante, we can remove it, does it work ?

If yes, I've updated the file.

 

Ricardo



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

Proud to be a Super User!



@camargos88   I grabbed the file again to see what you had done but doesn't appear to be updated.   I might not follow the logic and will probably make more sense when I see what you did to the pbix but wouldn't removing duplicates make everything unique?

@razraz2020 ,

 

I just saved it again.

 

No, we can remove duplicates based on restaurant and menu...so we will have just 1 combination.

 

Ricardo



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

Proud to be a Super User!



@camargos88   I still don't see this in the pbix, but I understand what you are saying and that would work.  Could I expand on this   since this is so simple (for you :-).  If there was a third column 'Person' who ate the menu item, how could I show the unique results.  Example Data:

RestaurantMenuPerson
McDonald'sCheesburgerMike
McDonald'sFillet of FishRob
McDonald'sFillet of FishMike
McDonald'sHamburgerJane
Burger KingCheesburgerBill
Burger KingHamburgerJoe
Wendy'sHamburgerSally
Wendy'sCheesburgerNancy
Wendy'sChicken SandwichFran
Wendy'sChicken SandwichJim
Wendy'sSaladJack

 

If I select McDonald's I would want the unique Menu items of the dataset 

McDonald'sFillet of FishRob
McDonald'sFillet of FishMike

 

or if I select Wendy's:

Wendy'sChicken SandwichFran
Wendy'sChicken SandwichJim
Wendy'sSaladJack

 

Thanks for dealing with my nonsense!

@razraz2020 ,

 

Capture 1.PNGCapture.PNG

 

I've updated the file: Download PBIX 

 

Ricardo



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

Proud to be a Super User!



@razraz2020 ,

 

If you consider it as a solution, please mark as a solution and kudos.

Ricardo



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

Proud to be a Super User!



az38
Community Champion
Community Champion

hi @razraz2020 

how do you plan to define what exactly Menu should be displayed for each restaraunt?

Why Fillet of Fish, not cheese for Mc?


do not hesitate to give a kudo to useful posts and mark solutions as solution
LinkedIn

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.