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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
mshamsiev
Helper I
Helper I

Counting Rows based on certain conditions and grouping

Hi all,

 

I'm trying to do a 'countifs' type calc. 

 

Essentially I have a list of assignment groups with multiple appearances within one column, and an 'Achieved' or 'Breached' status (as seen below). I wan't to determine the % achieved by assignment groups. That way I can hopefully create a KPI visual that will filter based on the selected assignment group or across the firm without filters.

 

Any help will be much appreciated. 

 

Example: 

Assg Group      Status

VC                    Achieved

VC                    Achieved

CRM                 Breached

CRM                 Achieved

 

-Mike 

1 ACCEPTED SOLUTION

@mshamsiev,

 

You could remove the FORMAT function above. Better to learn DAX basics before going ahead.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Try creating this measure

Breached Count = CALCULATE(
	DISTINCTCOUNT('Your Table'[Assg Group]),
	'YourTable'[Status] = "Breached"
)

This will give you a list of all of the Assg Groups that have at least 1 breached.

From here, if you do a distinct count of the entire list you'll be able to detiremine how many groups you have, then you can work backwards and figure out how many groups do not have breached.

 

Hi @Anonymous,

 

Thanks mate! I can see where you're going with the idea. But would that allow me to calculate Achieved % based on each individual assignment group? 

@mshamsiev,

 

You may refer to the following DAX that creates a new table.

Table =
SUMMARIZE (
    Table1,
    Table1[Assg Group],
    "Achieved %", FORMAT (
        COUNTROWS ( FILTER ( Table1, Table1[Status] = "Achieved" ) )
            / COUNTROWS ( Table1 ),
        "Percent"
    )
)
Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hey @v-chuncz-msft,

 

Worked a treat!! Thanks 🙂 Only issue is the resulting percentages are showing as txt and I cannot convert them to a numberical %. 

 

I was hoping to filter these SLA's by priorities 1-4 as each row has an assigned priority status. However, the SLA priorities are listed on the original SLA table (table1). 

 

Cheers,

Mike 

@mshamsiev,

 

You could remove the FORMAT function above. Better to learn DAX basics before going ahead.

Community Support Team _ Sam Zha
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-chuncz-msft,

 

Thanks again. Working on my DAX basics atm.

 

Cheers,

Mike 

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.

Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

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.