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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
badger123
Resolver I
Resolver I

Search in text and sum values measure

Hi all, looking for help with a measure please... 

 

I have measure (see below) which is searching for a given term in phrases in another table. I am displaying the output in a table visual with term as column 1 and count of term as column 2. I'd like to create a measure that sums up the phrase volumes. I've included tables and desired output below. 

 

Measure1 = 
VAR CurrWord =
SELECTEDVALUE ( 'Table1'[term] )
RETURN
COUNTROWS (
    CALCULATETABLE (
        VALUES ( Table2[phrase]),
        FILTER ( Table2
        , SEARCH ( CurrWord, Table2[phrase], 1, -1 ) > 0 ) ))

Table1

Term
apples
oranges
bananas

 

Table2

PhrasePhrase Volume
I like apples and oranges100
I do not like bananas200
I love apples the most300

 

DESIRED OUTPUT TABLE VISUAL:

TermMeasure 1Measure 2?
apples2400
oranges1100
bananas1200
1 ACCEPTED SOLUTION
LivioLanzo
Solution Sage
Solution Sage

@badger123 

 

you are nearly there, instead of doing

 

COUNTROWS (
    CALCULATETABLE (
        VALUES ( Table2[phrase]),
        FILTER ( Table2
        , SEARCH ( CurrWord, Table2[phrase], 1, -1 ) > 0 ) ))

you can do

 

calculate(sum( Table2[phrase volume]),
        FILTER ( Table2
        , SEARCH ( CurrWord, Table2[phrase], 1, -1 ) > 0 ) ))

 


 


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


Proud to be a Datanaut!  

View solution in original post

2 REPLIES 2
LivioLanzo
Solution Sage
Solution Sage

@badger123 

 

you are nearly there, instead of doing

 

COUNTROWS (
    CALCULATETABLE (
        VALUES ( Table2[phrase]),
        FILTER ( Table2
        , SEARCH ( CurrWord, Table2[phrase], 1, -1 ) > 0 ) ))

you can do

 

calculate(sum( Table2[phrase volume]),
        FILTER ( Table2
        , SEARCH ( CurrWord, Table2[phrase], 1, -1 ) > 0 ) ))

 


 


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


Proud to be a Datanaut!  

Thanks for your help! It seems so easy when you know the answer 😛 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

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.

Top Solution Authors