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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors