Forum Discussion
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.
| Countries | Food |
| America | Hot dogs |
| America | Corn dogs |
| America | Bigmacs |
| Ireland | Stew |
| Ireland | Cabbage and bacon |
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
3 Replies
- Akash_VarunaSuper 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 - v-echaithraCommunity 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. - v-echaithraCommunity 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.