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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
Pintobean80
Regular Visitor

Creating a slicer that searches for a word contained in a row

I have two tables in Power BI. Table 1 contains the following "Functions" column.

Pintobean80_0-1710897421642.png

Table 2 has all the Functions for the slicer (one word per row).

Pintobean80_1-1710897558160.png

I want to create a slicer using the column in Table 2 to that should let users select a single function and show all rows that "contain" that function. So if Data Analytics is selected, it should show the following two rows

Pintobean80_2-1710897673661.png

I tried creating a relationship between both columns: many to many and cross filter both, but nothing seems to work. When I selected a function in the slicer, everything vanishes. I have no idea how to make this work. Please help!

1 ACCEPTED SOLUTION
v-xinruzhu-msft
Community Support
Community Support

Hi @Pintobean80 

You can refer to the following solution.

Sample data 

Table1

vxinruzhumsft_0-1711001301710.png

Tabke (2)

vxinruzhumsft_1-1711001318382.png

Create a measure

Measure = COUNTROWS(FILTER('Table (2)',CONTAINSSTRINGEXACT(MAX('Table'[Functions]),[FunctionsSlicer])))

Then put the measure to the visual filter.

vxinruzhumsft_2-1711001359581.png

Output

vxinruzhumsft_3-1711001376605.png

vxinruzhumsft_4-1711001397598.png

Best Regards!

Yolo Zhu

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

 

 

 

View solution in original post

7 REPLIES 7
v-xinruzhu-msft
Community Support
Community Support

Hi @Pintobean80 

You can refer to the following solution.

Sample data 

Table1

vxinruzhumsft_0-1711001301710.png

Tabke (2)

vxinruzhumsft_1-1711001318382.png

Create a measure

Measure = COUNTROWS(FILTER('Table (2)',CONTAINSSTRINGEXACT(MAX('Table'[Functions]),[FunctionsSlicer])))

Then put the measure to the visual filter.

vxinruzhumsft_2-1711001359581.png

Output

vxinruzhumsft_3-1711001376605.png

vxinruzhumsft_4-1711001397598.png

Best Regards!

Yolo Zhu

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

 

 

 

PijushRoy
Super User
Super User

Hi @Pintobean80 

Create a relationship between two tables with Function column
Many to Many and Table 2 filter Table 1
Create a Slicer with a search option. Use the multi-select option. So users can search and select multiple value if needed

PijushRoy_0-1710900443959.png

 


Let me know if that works for you


If your requirement is solved, please mark THIS ANSWER as SOLUTION ✔️ and help other users find the solution quickly. Please hit the Thumbs Up 👍 button if this comment helps you.

Thanks
Pijush
Linkedin

Unfortunately that doesn't work. I created the relationship as you said, and then created the slicer using the column in Table 2. I select anything, and the table just vanishes instead of showing the rows.

Please create a pbix containing sample data that still reflects your semantic model (tables, relationships, calculated columns, and measures). Upload the pbix to OneDrive, Google Drive, or Dropbox and share the link in this thread. If you are using a spreadsheet to create/import the sample data instead of the manual import method, share the spreadsheet.

Here is a link to the sample. I tried again, and it seems to bring up only rows with that exact word but not the other rows that contain it.

 

https://docs.google.com/spreadsheets/d/1fnaecEMfCiSIxyHYmLm-vhhD79D7UdSr/edit?usp=sharing&ouid=10516...

Hi,

In the Query Editor, split the Functions column into rows using the ; delimiter.  Now create a relationship (Many to One and Single) from the Functions column of Table 1 to Table 2.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I tried that but on the table, I want to see all functions for the each row. I don't want multiple rows of San Antonio with one function each. I want the single row of San Antonio with all 3 functions it contains shown.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

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