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
romovaro
Responsive Resident
Responsive Resident

Count 2 requirements same column

Hi Power BI community

 

I need your help. I need to count how many customers (using the CID Column) meet these 2 requirements that are in the same column (Task Column):

 

TaskColumn: IPM HAndOFF & Pre Engagement Process 

Task_status Column is closed

 

Sample table below:

 

In that Case Customer A should count (2 requirements ok + task status closed) but Customer B no (task_status is Received, not closed)

 

CLIENT_NAMECIDINSTANCE_NUMBERTASKTASK_STATUS
Customer A380263997543IPM HandOffClosed
Customer A380263997543Resource AllocationClosed
Customer A3802631041927Partner Assignment  Closed
Customer A3802631041924Partner Assignment  Closed
Customer A380263997543Pre Engagement ProcessClosed
Customer B3802631041935IPM HandOffReceived
Customer B3802631041933Partner Assignment  Received
Customer B3802631041934Partner Assignment  Received
Customer A380263997543Client System SetupClosed
Customer A380263997543Pre Engagement ProcessClosed

 

Tried different formulas but nothing so far.. 

Tasks IPM HandOff & Closed = CALCULATE(
FILTER(CELERGO_12062021V1, CELERGO_12062021V1[TASK] = "Pre Engagement Process"), CELERGO_12062021V1[TASK] = "IPM HandOff")
 
 
Thanks,
1 ACCEPTED SOLUTION

Try this:-

Tasks IPM HandOff & Closed = 
VAR result =
    CALCULATE (
        DISTINCTCOUNT( CELERGO_12062021V1[CID] ),
        FILTER (
            CELERGO_12062021V1,
            CELERGO_12062021V1[TASK]
                IN { "Pre Engagement Process", "IPM HandOff" }
                && CELERGO_12062021V1[TASK_STATUS] = "Closed"
        )
    )
RETURN
    IF ( ISBLANK ( result ), 0, result )

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

View solution in original post

4 REPLIES 4
romovaro
Responsive Resident
Responsive Resident

Thanks Samarth_18.

 

the formula is counting all the customers that has one of the 2 requirements?. Is it possible to adapt the formula to show only the ones (CID or Client_Name) that has the 2 requirements, maybe?

 

IN { "Pre Engagement Process" and "IPM HandOff" }

 

 

romovaro
Responsive Resident
Responsive Resident

Thanks Samarth_18.

 

It works :). Now I have a problem and is that I just realized that the total number is showing "double amount of clients"

 

The Same client (CID) goes to different processes...Pre Engagment team, Partner Assignment...and IPM Handoff

With this formula it counts all the times we have the 2 requirements....ANy way to count only Once?

 

I can use the filter and Ask POwer Bi to show only total = 2 (meaning 2 requirements are good)...but If I can remove duplicates?

 

thanks again

Try this:-

Tasks IPM HandOff & Closed = 
VAR result =
    CALCULATE (
        DISTINCTCOUNT( CELERGO_12062021V1[CID] ),
        FILTER (
            CELERGO_12062021V1,
            CELERGO_12062021V1[TASK]
                IN { "Pre Engagement Process", "IPM HandOff" }
                && CELERGO_12062021V1[TASK_STATUS] = "Closed"
        )
    )
RETURN
    IF ( ISBLANK ( result ), 0, result )

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

Samarth_18
Community Champion
Community Champion

Hi @romovaro ,

You can use code as below:-

 

Tasks IPM HandOff & Closed = 
VAR result =
    CALCULATE (
        COUNT ( CELERGO_12062021V1[CID] ),
        FILTER (
            CELERGO_12062021V1,
            CELERGO_12062021V1[TASK]
                IN { "Pre Engagement Process", "IPM HandOff" }
                && CELERGO_12062021V1[TASK_STATUS] = "Closed"
        )
    )
RETURN
    IF ( ISBLANK ( result ), 0, result )

 

 

Output:-

 

image.png

Thanks,

Samarth

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

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.