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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Anonymous
Not applicable

The True/False expression does not specify a column...

Hello!

 

I need to use a measure filter in a calculate of sum. 

 

My Sum =
VAR t = CALCULATETABLE(DISTINCT(ALLSELECTED(List1[Keyword])), FILTER(List, CONTAINSSTRINGEXACT(MAX(Table[Text]), List1[Keyword])=TRUE()))
VAR x = COUNTX(t, List1[Keyword])
RETURN CALCULATE(SUM(Table[Value]), NOT(ISBLANK(x)))
 
With x as separate measure and visual filter works, but I need a calculation that doesn't use a visual filter, but DAX.
 
It should find the selected keywords in a text column (multiple selection possible) and sum the values that correspond to the texts found to contain the keywords only.
 
How can I fix my DAX without the error message?
2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , Based on what I got, It should be

 

CALCULATETABLE(DISTINCT(ALLSELECTED(List1[Keyword])), FILTER(List1, List1[Keyword] in values( Table[Text])  ))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

It looks better, but makes no difference to the error message. This comes from x being a measure, that's why it won't calculate with a condition coming from a measure and not a column. (It's the same if I use t directly, e.g. using NOT(ISEMPTY(t)) in the condition.) 

 

I need to sum only the values for which there is at least a text containing the one of the selected keywords, i.e. for which x is not blank (ot t not empty). 

I don't know how else to avoid this in CALCULATE.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.