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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
brianlehr
Microsoft Employee
Microsoft Employee

Percentage of rows with specific string

Easy question here (I think, as I haven't done PowerBI in a couple years and all my skills have left me):

 

I have a table like this

TeamStatus
Team1Red
Team1Green
Team2Red
Team2Yellow
Team2Red
Team2Green

 

My usecase is that I want to be able to count the number of rows that are of status Red, status Yellow, and status Green...and then have a separate multi-row card that shows percentage in each.  It should also be able to change based on what Team is selected, so I'm guessing I need a measure.

So for example, with no filters applied, it should show 50% Red, 17% Yellow, 33% Green

If I filter to only Team2, it should show 50% Red, 25% Yellow, 25% Green

Would also be cool to have a way to show % of a certain color for each team.

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@brianlehr 

pls create a status table 

and create a measure

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Status]=max('Table (2)'[status]))/COUNTROWS('Table')

1.PNG

 





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@brianlehr 

pls create a status table 

and create a measure

Measure = CALCULATE(COUNTROWS('Table'),'Table'[Status]=max('Table (2)'[status]))/COUNTROWS('Table')

1.PNG

 





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

Proud to be a Super User!




This works, thank you!

MahyarTF
Memorable Member
Memorable Member

Hi,

To show the Teamname add the below column to your table :

TeamName = left(Sheet43[Team Status],5)
Then create three separate Measure for each color :
YellowRatio =
Var Allcnt = COUNT(Sheet43[Team Status])
Var Yellowcnt = CALCULATE(count(Sheet43[Team Status]),
                        SEARCH("Yellow",Sheet43[Team Status],1,0)
)
return COALESCE( Yellowcnt/Allcnt, 0)
* Do this for other colors (change the color in the search function)
- select 'Percentage' as a Format for particular measures.
- use the measure in your Multi card Visual
MahyarTF_0-1658796714267.png

 

Mahyartf

Accepted the other answer since I tried it first, but I'm going to also try this to see if it gives more flexibility.  Never used the COALESCE command before.  Thanks!

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.