Forum Discussion

Lauraeire_81's avatar
Lauraeire_81
Helper I
1 year ago
Solved

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,...
  • Akash_Varuna's avatar
    1 year ago

    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