cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Frequent Visitor

COUNTIF & COUNTIFS

Hi all,


I'm trying to replicate the following Excel formula in a column that lives in PowerBI, and I'm having some trouble. The formula should pull complete if all items for a certain grouping are complete. If only partial items are complete for the grouping, the result should be incomplete.

 

=IF(COUNTIF(A:A,A2)-COUNTIFS(A:A,A2,C:C,"COMPLETE")=0,"COMPLETE","INCOMPLETE")

 

GroupingItemItem StatusGrouping Status
BFW1CompleteINCOMPLETE
BFW2CompleteINCOMPLETE
BFW3IncompleteINCOMPLETE
BFW4IncompleteINCOMPLETE
HP NITROGEN5CompleteCOMPLETE
HP NITROGEN6CompleteCOMPLETE

 

Any idea how to replicate this formula in PowerBI when COUNTIF and COUNTIFS do not exist?

All help is appreciated...

1 ACCEPTED SOLUTION
Super User IV
Super User IV

@Kiewit 

Ads this as a column to your table: 

Status = 
IF(
    CALCULATE( COUNTROWS(Table1) , Table1[Item Status] = "Incomplete", ALLEXCEPT(Table1,Table1[Grouping])) > 0,
    "Incomplete",
    "Complete"
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Website   YouTube    LinkedIn

View solution in original post

1 REPLY 1
Super User IV
Super User IV

@Kiewit 

Ads this as a column to your table: 

Status = 
IF(
    CALCULATE( COUNTROWS(Table1) , Table1[Item Status] = "Incomplete", ALLEXCEPT(Table1,Table1[Grouping])) > 0,
    "Incomplete",
    "Complete"
)

 

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Website   YouTube    LinkedIn

View solution in original post

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Microsoft Ignite

Microsoft Ignite with Arun Ulag

Featured Session: Drive Data Culture with Power BI- Vision, Strategy & Roadmap. Register here https://myignite.microsoft.com #MSIgnite #PowerPlatform #Power BI ​

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.