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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Luisch
Regular Visitor

Problem with filters

Hi 

 

I have this column in a Power BI table with those possible values:

conditions
Colab
ColabCustomers
Customers
CustomersGLUCUBERS
CustomersHyper
GLUCUBERS
GLUCUBERSTest
Hyper
PRUEBA
Test

 

I want to create a filter with only the values: test, glucubers, customers, prueba, colab, and hyper. When I apply the filter, I want it to filter that table. Here's the thing: I want it so that if I filter for customers, only customers appears and not something like customersGlucubers. However, if I select two values in the filter, for example customers and glucubers, the table should be filtered by the values customers, glucubers, and their combination, in this case customersGlucubers.

 

Anyone could help me.

Thanks!

1 ACCEPTED SOLUTION
rajendraongole1
Super User
Super User

Hi @Luisch - create a calculated column that identifies the rows based on your filtering logic

FilterFlag =
VAR SelectedValues = {"test", "glucubers", "customers", "prueba", "colab", "hyper"}
VAR ConditionLowerCase = LOWER('YourTable'[conditions])
RETURN
IF(
COUNTROWS(
FILTER(
SELECTCOLUMNS(
SelectedValues,
"SelectedValue",
[Value]
),
ConditionLowerCase = [SelectedValue] ||
LEFT(ConditionLowerCase, LEN([SelectedValue])) = [SelectedValue]
)
) > 0,
TRUE,
FALSE
)

 

Use the above calculated column FilterFlag i, when you are in use in your visuals.
Apply the FilterFlag column to the visual-level or page-level filters and set it to filter for TRUE. This will ensure only rows that match your criteria are displayed.The slicer based on Filteroption allows users to select the criteria

create a disconnected table:

Code:

FilterOptions =
DATATABLE(
"FilterValue", STRING,
{
{"test"},
{"glucubers"},
{"customers"},
{"prueba"},
{"colab"},
{"hyper"}
}
)

rajendraongole1_0-1724482186690.png

 

filter the main table based on multiple selections from the slicer, you can create a measure that checks for the presence of each selected value and then filters the main table

FilteredValues =
VAR SelectedItems = VALUES(FilterOptions[FilterValue])
RETURN
IF(
COUNTROWS(
FILTER(
'YourTable',
'YourTable'[FilterFlag] = TRUE &&
(
ISBLANK(SELECTEDVALUE('YourTable'[conditions])) ||
CONCATENATEX(SelectedItems, [FilterValue], ",", 'YourTable'[conditions]) = [conditions]
)
)
) > 0,
1,
0
)

You can then use this measure as a visual filter or conditional format in your visuals to highlight or display only the relevant rows

rajendraongole1_1-1724482370446.png

 

Hope this measure filtered values ensures the table filters correctly based

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





View solution in original post

2 REPLIES 2
Krina234pestro
New Member

Hello,

reate a calculated column that identifies the rows based on your filtering logic

FilterFlag =
VAR SelectedValues = {"test", "glucubers", "customers", "prueba", "colab", "hyper"}
VAR ConditionLowerCase = LOWER('YourTable'[conditions])
RETURN
IF(
COUNTROWS(
FILTER(
SELECTCOLUMNS(
SelectedValues,
"SelectedValue",
[Value]
),
ConditionLowerCase = [SelectedValue] ||
LEFT(ConditionLowerCase, LEN([SelectedValue])) = [SelectedValue]
)
) > 0,
TRUE,
FALSE
)

 

Use the above calculated column FilterFlag i, when you are in use in your visuals.
Apply the FilterFlag column to the visual-level or page-level filters and set it to filter for TRUE. This will ensure only rows that match your criteria are displayed.The slicer based on Filteroption allows users to select the criteria

create a disconnected table:

Code:

FilterOptions =
DATATABLE(
"FilterValue", STRING,
{
{"test"},
{"glucubers"},
{"customers"},
{"prueba"},
{"colab"},
{"hyper"}
}
)

rajendraongole1_0-1724482186690.png

 

filter the main table based on multiple selections from the slicer, you can create a measure that checks for the presence of each selected value and then filters the main table

FilteredValues =
VAR SelectedItems = VALUES(FilterOptions[FilterValue])
RETURN
IF(
COUNTROWS(
FILTER(
'YourTable',
'YourTable'[FilterFlag] = TRUE &&
(
ISBLANK(SELECTEDVALUE('YourTable'[conditions])) ||
CONCATENATEX(SelectedItems, [FilterValue], ",", 'YourTable'[conditions]) = [conditions]
)
)
) > 0,
1,
0
)

You can then use this measure as a visual filter or conditional format in your visuals to highlight or display only the relevant rows

rajendraongole1_1-1724482370446.png

 

Hope this measure filtered values ensures the table filters correctly based

 

 

It's work thanks for make my work a lot easier. myfordbenefits

rajendraongole1
Super User
Super User

Hi @Luisch - create a calculated column that identifies the rows based on your filtering logic

FilterFlag =
VAR SelectedValues = {"test", "glucubers", "customers", "prueba", "colab", "hyper"}
VAR ConditionLowerCase = LOWER('YourTable'[conditions])
RETURN
IF(
COUNTROWS(
FILTER(
SELECTCOLUMNS(
SelectedValues,
"SelectedValue",
[Value]
),
ConditionLowerCase = [SelectedValue] ||
LEFT(ConditionLowerCase, LEN([SelectedValue])) = [SelectedValue]
)
) > 0,
TRUE,
FALSE
)

 

Use the above calculated column FilterFlag i, when you are in use in your visuals.
Apply the FilterFlag column to the visual-level or page-level filters and set it to filter for TRUE. This will ensure only rows that match your criteria are displayed.The slicer based on Filteroption allows users to select the criteria

create a disconnected table:

Code:

FilterOptions =
DATATABLE(
"FilterValue", STRING,
{
{"test"},
{"glucubers"},
{"customers"},
{"prueba"},
{"colab"},
{"hyper"}
}
)

rajendraongole1_0-1724482186690.png

 

filter the main table based on multiple selections from the slicer, you can create a measure that checks for the presence of each selected value and then filters the main table

FilteredValues =
VAR SelectedItems = VALUES(FilterOptions[FilterValue])
RETURN
IF(
COUNTROWS(
FILTER(
'YourTable',
'YourTable'[FilterFlag] = TRUE &&
(
ISBLANK(SELECTEDVALUE('YourTable'[conditions])) ||
CONCATENATEX(SelectedItems, [FilterValue], ",", 'YourTable'[conditions]) = [conditions]
)
)
) > 0,
1,
0
)

You can then use this measure as a visual filter or conditional format in your visuals to highlight or display only the relevant rows

rajendraongole1_1-1724482370446.png

 

Hope this measure filtered values ensures the table filters correctly based

 

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.