March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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 this filter to be able to show names based on a color, with that color being in any of the three positions. For instance, If I were to click Blue I would want it to filter to Bill, David, Roger, Steven and Thomas as they all have blue somewhere in their color preference.
I have tried approaching this a few different ways. I have tried splitting the columns by delimeter into separate columns. The problem when I do that is the filter will only recognize the first entry so if I were to click Blue only Thomas would show up. Also I still only want one column for Color Preference and this splits Color Preference into 3 columns:
I have also tried using the delimeter to split them into multiple rows but then the issue becomes I have multiple rows repeating the same persons name:
Is there anyway to create the filter I need?
Solved! Go to Solution.
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.
Proud to be a Super User! | |
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.
Proud to be a Super User! | |
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
132 | |
90 | |
88 | |
64 | |
58 |
User | Count |
---|---|
203 | |
141 | |
107 | |
73 | |
70 |