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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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