cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ssbagley
Helper III
Helper III

Keywords Lookup - DirectQuery

I have a table of keywords and want to search the Expenses[Description] column and return results either in a column or filtered table of all rows containing the keyword.

This calculated column works great in my Sample data, but my live data is Direct Query and I cannot add this column.  Any thoughts on making it work with Direct Query?

Sample: https://drive.google.com/file/d/1OBH19U2hwxf1lj2_l-po3Wo2y-2mmE1K/view?usp=share_link

 

Filter =
VAR Keywords =
    FIRSTNONBLANK (FILTER (VALUES ( 'Table'[Keywords] ), SEARCH ( 'Table'[Keywords], Expenses[Description], 1, 0 )),1)
RETURN IF ( NOT ( ISBLANK ( Keywords ) ), Keywords, "" )
1 REPLY 1
amitchandak
Super User
Super User

@ssbagley , Create a measure like

maxx(filter('Table', SEARCH ( 'Table'[Keywords], Expenses[Description], 1, 0 )>0), 'Table'[Keywords] )

 

plot with Keywords

 

Countx(filter('Table', SEARCH ( 'Table'[Keywords], Expenses[Description], 1, 0 )>0), 'Table'[Keywords] )



!! Microsoft Fabric !!
Microsoft Power BI Learning Resources, 2023 !!
Learn Power BI - Full Course with Dec-2022, with Window, Index, Offset, 100+ Topics !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors