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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
y2gabs
Frequent Visitor

CountX + filter when filter condition is in another table - Directquery

 Hi there.  Likely a newb question, and I don't even know if I'm on the right track here, but I'm basically trying to get a count of tasks in a "tasks" table where related opportunity status in "opportunities" table = "won".  This is what I'm trying:

 

COUNTX(filter(enhancedopportunity,enhancedopportunity[StateCodevalue]="Won"),enhancedtask[MeasureCountTasks])

 

but I seem to be getting the following error:

"Function 'COUNTX' is not supported in this context in DirectQuery mode."

 

My end goal is to get a % total of tasks where regarding opportunity status = "won"... or % of total tasks that result in won opportunities and my thought was to keep it simple by getting counts in two new columns and then divide one column by the other. There may be another way to accomplish this that my newbie brain can't fathom 🙂

 

Any help would be greatly appreciated.  Thanks!

 

 

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

@y2gabs,

 

You may just replace enhancedtask[MeasureCountTasks] with number 1.

Community Support Team _ Sam Zha
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

1 REPLY 1
v-chuncz-msft
Community Support
Community Support

@y2gabs,

 

You may just replace enhancedtask[MeasureCountTasks] with number 1.

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

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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