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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Lauraeire_81
Helper I
Helper I

Display categories in table

Hi 

I am looking to display the Countries listed depending on what food items are selected in a slicer (where multiple options can be selected).

Say 'Hot Dogs', 'Corn dogs' and 'Stew' are selected, I want a measure to say something like this:

'Corn Dogs' and 'Hot dogs' found in 'America'. Count of 2. 

'Stew' is found in Ireland. Count of 1.

 

Is there any way to search on a table like this and display the items in a similar format?

Thanks in advance,

Laura

 

See table 'CountryFood' below. 

CountriesFood
AmericaHot dogs
AmericaCorn dogs
AmericaBigmacs
Ireland Stew
Ireland Cabbage and bacon
1 ACCEPTED SOLUTION
Akash_Varuna
Super User
Super User

Hi @Lauraeire_81 Try this please 

SelectedFoodSummary = 
VAR SelectedFoods = VALUES('CountryFood'[Food])
VAR Result = 
    CONCATENATEX(
        SELECTCOLUMNS(
            FILTER('CountryFood', 'CountryFood'[Food] IN SelectedFoods),
            "Summary", 
            'CountryFood'[Food] & " found in " & 'CountryFood'[Countries] & "."
        ),
        [Summary], 
        " Count of " & COUNTROWS(FILTER('CountryFood', 'CountryFood'[Food] IN SelectedFoods)) & ". ", 
        UNICHAR(10)
    )
RETURN Result

View solution in original post

3 REPLIES 3
v-echaithra
Community Support
Community Support

Hi @Lauraeire_81 

we wanted to kindly follow up to check if the solution provided for the issue worked? or Let us know if you need any further assistance?
If our response addressed, please mark it as Accept as solution and click Yes if you found it helpful.

Regards,
Chaithra.

v-echaithra
Community Support
Community Support

Thanks @Akash_Varuna  for Addressing the issue.

 

we would like to follow up to see if the solution provided by the super user resolved your issue. Please let us know if you need any further assistance.
If the above response resolved your issue, please mark it as "Accept as solution" and click "Yes" if you found it helpful.

 

Regards,
Chaithra.

Akash_Varuna
Super User
Super User

Hi @Lauraeire_81 Try this please 

SelectedFoodSummary = 
VAR SelectedFoods = VALUES('CountryFood'[Food])
VAR Result = 
    CONCATENATEX(
        SELECTCOLUMNS(
            FILTER('CountryFood', 'CountryFood'[Food] IN SelectedFoods),
            "Summary", 
            'CountryFood'[Food] & " found in " & 'CountryFood'[Countries] & "."
        ),
        [Summary], 
        " Count of " & COUNTROWS(FILTER('CountryFood', 'CountryFood'[Food] IN SelectedFoods)) & ". ", 
        UNICHAR(10)
    )
RETURN Result

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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