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

Join the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. 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
April Power BI Update Carousel

Power BI Monthly Update - April 2026

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

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.

FabCon and SQLCon Highlights Carousel

FabCon &SQLCon Highlights

Experience the highlights from FabCon & SQLCon, available live and on-demand starting April 14th.