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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
equevedo84
Frequent Visitor

Recreating COUNTIF formula into Measure in Power BI

Hey everyone,

 

I'm transitioning an Excel report into Power BI and want to adapt a COUNTIFS formula in the Excel report into a Power BI measure.  The current COUNTIFS formula reads as follows: =COUNTIFS($K:$K,"Non-Compliant",$J:$J,$J2,$H:$H,$H2,$A:$A,$A2).  K column is a Status column which has only two values Compliant or Non-Compliant.  Column J is a Measure column containing text of different Measure descriptions, column H contains doctor names, and column A contains insurance names.  The formula is obviously counting the occurrence of the Status Compliant or Non-Compliant in the given three way combo of Measure/Doctor/Insurance name, so one doctor that is paired with a given measure description and insurance that is Non-Compliant is counted occurrence of 11x.  Any help is greatly appreciated.

 

Thanks

1 ACCEPTED SOLUTION
HotChilli
Community Champion
Community Champion

Substitute your own column/table names. This is a calculated column.

ColumnNonCompliant = 
var _Payer = TableT[Column1]
var _Prov =  TableT[Column2]
var _Meas = TableT[Column3]
var _stat = TableT[Status]

RETURN
COUNTROWS(FILTER(TableT, TableT[Column1] = _Payer && TableT[Column2] = _Prov && TableT[Column3] = _Meas && TableT[Status] = "Compliant"))

 Post your data next time please, not a picture

View solution in original post

7 REPLIES 7
HotChilli
Community Champion
Community Champion

No problem. Let me know how it works for you.

--

For posting on the forum:

https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-... 

HotChilli
Community Champion
Community Champion

Substitute your own column/table names. This is a calculated column.

ColumnNonCompliant = 
var _Payer = TableT[Column1]
var _Prov =  TableT[Column2]
var _Meas = TableT[Column3]
var _stat = TableT[Status]

RETURN
COUNTROWS(FILTER(TableT, TableT[Column1] = _Payer && TableT[Column2] = _Prov && TableT[Column3] = _Meas && TableT[Status] = "Compliant"))

 Post your data next time please, not a picture

Worked just like I wanted it, thanks!

Thank you very much for your response.  I tried to post the data sample as an attachment but could not find a button or option for file attachment.

equevedo84
Frequent Visitor

Screen Shot of original Excel:

 

equevedo84_0-1714578207245.png

HotChilli
Community Champion
Community Champion

You will get a quicker answer if you post a small, fake data sample and show the desired result.

equevedo84_0-1714592052910.png

 

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.