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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Jonnokc
Frequent Visitor

Percent of text values in a column

Hello,

 

Would anyone be able to provide some advice about how to find the percentage of specific text values in a column?

 

For example if I have a column that contains text values of either, "yes" or "no" and I want to find out the percentage of "no" and "yes" values against the total values for the column.

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

Lots of potential ways of doing this, one way would be to create a new column like this:

 

CountofYes=IF(IFERROR(SEARCH("yes",[YesNo]),0),1,0)

 

This will give you 1 in the column for all the yes values and 0 for anything else.

 

You could then create a measure that did a SUM on the "CountofYes" column divided by the COUNT of your records to get you a percentage. Percent of "no" would be 1 minus the new measure.

 

Something like that.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

5 REPLIES 5
Greg_Deckler
Community Champion
Community Champion

Lots of potential ways of doing this, one way would be to create a new column like this:

 

CountofYes=IF(IFERROR(SEARCH("yes",[YesNo]),0),1,0)

 

This will give you 1 in the column for all the yes values and 0 for anything else.

 

You could then create a measure that did a SUM on the "CountofYes" column divided by the COUNT of your records to get you a percentage. Percent of "no" would be 1 minus the new measure.

 

Something like that.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

I was hoping to find a solution in which I could keep the % of each value in the same table so I could create a table with one column that shows the % for each value. Is this possible? 

 

 

I usually perform this task  in Access. I can obviously still do this. I am just seeing if it is possible to use Power Bi for all my needs instead of two programs.

Using a measure instead of a column should give you the result you are looking for.  That measure will be always up to date based on that table.  So if you have 50% Yes, and then add some more rows with Yes, the Percentage will increase accordingly.

 

Then you can call against that measure in other visualizations - so if you had a Sales Table and a Customer Table, you could create the measure both places, and then see your Sales[PctYes] vs Customer[PctYes].

 

 

Can you give us an example of how you will be using it?

ALeef
Resolver II
Resolver II

Measure:

 

PctYes = (Calculate(counta('Table'[Response]), 'Table'[Response] = "Yes")) / (Countrows ('TableName')

 

I think syntax is right, but not positive.

I've been searching for this for the past 4 days, and you the only one who wrote for me the right equation. THANK YOU!.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors