Forum Discussion

Nicholas_B's avatar
Nicholas_B
New Member
3 years ago
Solved

Creating filter for multiple values in one column

Hello,    I am having an issue creating a filter that will let me filter items with mulitple values in a column separated by commas. Here is an example of the table I am using:    I want th...
  • jgeddes's avatar
    3 years ago

    One way to approach it would be to create a second table with your colors, but do not relate it to the original table. Use this table as the filter.

    Create a measure that looks for the selected value in the color table and and then looks in the color preference column for that value.

    filteredNames = 
    var _selectedColor =
    IF(
        HASONEVALUE(colors[Color]),
        SELECTEDVALUE(colors[Color])
    )
    var _nameCalc =
    CALCULATE(
        MIN('Table'[Name]),
        FILTER('Table', CONTAINSSTRING('Table'[Color Preference], _selectedColor))
    )
    Return
    _nameCalc

    As long as you keep the color preference column in your table you will get the result you are looking for.