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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
gco
Resolver II
Resolver II

Slicer from a list of keywords

I have 2 tables, 1 with accountnumbers, and notes fields.  And the other table has keywords.

 

I was able to create a slicer based on Keywords, but it is not able to filter Table 1.  If I do it in SQL, it would be something like 'SELECT AccountNumbers, Notes From TableName WHERE notes like '%keywords%''.  Your help is much appreciated.

 

Thank you

Glen

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

Hi @gco 

If i understand you correctly, create measures

selected keywords = SELECTEDVALUE(table2[key words])

select rows =
IF (
    ISERROR ( FIND ( [selected keywords], MAX ( account[notes] ), 1, 0 ) ),
    0,
    FIND ( [selected keywords], MAX ( account[notes] ), 1, 0 )
)

Capture14.JPG

Best Regards
Maggie

 

Community Support Team _ Maggie Li
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

4 REPLIES 4
v-juanli-msft
Community Support
Community Support

Hi @gco 

If i understand you correctly, create measures

selected keywords = SELECTEDVALUE(table2[key words])

select rows =
IF (
    ISERROR ( FIND ( [selected keywords], MAX ( account[notes] ), 1, 0 ) ),
    0,
    FIND ( [selected keywords], MAX ( account[notes] ), 1, 0 )
)

Capture14.JPG

Best Regards
Maggie

 

Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-juanli-msft 

You are a genius!!! Your measures worked perfectly.

 

Can i ask you one more question?  How do i now accurately show the row count for my table based on the selection?  On the filtered view, it shows the rows correctly.  But if i create a card or table that shows the count, it still shows the total number of rows without the filter applied.  And i tried applying the [select rows] filter, but it becomes readonly - so i am not able to change it to "is not 0".

 

Thank you again

Glen

I found my solutions for the row count.  I created a measure as below:

 

RowCount = CALCULATE(COUNTROWS(RELATEDTABLE(Table1)),FILTER(Table1,[Selected Rows])).

 

Thanks again @v-juanli-msft 

@v-juanli-msft the measures you gave me has been working perfectly.  But i was asked a question by my user if it is possible to select multiple keywords.  Do you know if that is possible?  I was able to change the Selected Keywords measure to CONCATENATEX ( Values (SearchStrings[SearchStringVal], [SearchStringVal], ",").  But i could not figure out how to do the Selected Row.

 

When you have time, would you mind sharing me the measure for this?

Thank you

Glen

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors