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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Anonymous
Not applicable

COUNTIFS functionality on a column range using M Query

Attached is an excel example of exactly what I want to achieve in Power BI.

 

I have a dataset, and I want to count along each row of the dataset - pointing to a particular range of columns - the number of instances of a particular word or words. In Excel this uses Countifs of Countif.

 

So the conditional columns I want to replicate in Power BI are columns O to Q in the attached image. I can't attach it as a document so i've shown the formulas instead of the values. 

 

The table name is Jemma

Column N [Elements Checked] counts the instances of the words 'Pass' or 'Fail' in the specified range. It basically excludes 'N/A'

Column O [Pass Count] counts just the instances of the word 'Pass' in the specified range.

Column P [Fail Count] counts just the instances of the word 'Fail' in the specified range.

 

I would love to do this in Power Query using M query language.

Capture.PNG

1 REPLY 1
v-lili6-msft
Community Support
Community Support

hi, @Anonymous 

It seems that you had forgotten to upload the file.

Sample data and expected output would help tremendously. Please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

Best Regards,
Lin

 

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

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.