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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
AravindhPi
New Member

Help Needed: Filtering Visuals with User-Selected Value in Multi-Value Columns

Hi everyone,

 

I'm facing an issue with filtering visuals based on user selections and could really use some help. Here's the situation:

 

    I have a column in my table that contains multiple values in the same cell (e.g., "apple, banana, cherry").
    I want the user to be able to select a single value dynamically (like "apple").
   The goal is for the visuals to filter based on this user-selected value, even though the column contains multiple values.

 

For example, if the user selects "apple", the visual should filter to show rows where the column includes "apple" among other values.

 

The source is shared dataset and it is in live connection

 

What I did for this is that I have created a table in source, which has distinct values in each row, then I have added the created table to the semantic model.

Idea is to provide the new table values as input to the filter. If the user selects any value then it should filter the existing table column. however when I try to show it in the slicer, I am getting the following error:

 

AravindhPi_0-1717501116921.png

Note: (there is no relationship established and if we do, we will end up with multiple duplicates) 

 

I have used the following Dax for checking and filtering user input, if the slicer worked:

 

FilteredRows =
VAR SelectedCode = SELECTEDVALUE(New Table[Single value column])
VAR Result = 
IF (
ISBLANK(SelectedCode),
BLANK(),
IF (
CONTAINSSTRING(SELECTEDVALUE(Exisitn Table [Multivalue column] ), SelectedCode),
1,
BLANK()
)
)

RETURN Result

 

I've been struggling to get this to work and would appreciate any advice or solutions you can offer. Has anyone dealt with a similar scenario before?

 

Thanks in advance for your help! @amitchandak @Ashish_Mathur @lbendlin @Ritaf1983 

 

Best regards,
AravindhPi

2 REPLIES 2
AravindhPi
New Member

Hi @v-jiewu-msft 
Thanks for your reply!

 

I have followed the same steps, however I got the below error in the visual

AravindhPi_0-1717588067806.png

Could you please help me to solve this

Thanks You,

AravindhPi

v-jiewu-msft
Community Support
Community Support

Hi @AravindhPi ,

Based on my testing, please try the following methods again:

1.Create the simple table.

vjiewumsft_0-1717566973897.png

vjiewumsft_1-1717566984447.png

2.Drag the fruit field into the slicer visual.

vjiewumsft_2-1717567000965.png

3.Create the new measure to filter the column contains selected value.

Measure = 
var frui_ = SELECTEDVALUE('Table test'[Fruit])
var t_fruit = SELECTEDVALUE('Table'[Sales])
RETURN
IF(CONTAINSSTRING(t_fruit, frui_), 1, 0)

4.Set the show items is 1 in filters pane.

vjiewumsft_3-1717567010375.png

5.The result is shown below.

vjiewumsft_4-1717567025730.png

Best Regards,

Wisdom Wu

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

Find out what's new and trending in the Fabric Community.

Top Kudoed Authors