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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
abukapsoun
Post Patron
Post Patron

Percentage of certain cell value

Hi, 

 

Need your kind help please, How can I calculate the % of "Good" per country? 

 

Column1Column2
Country1Good
Country1Good
Country1Bad
Country2Good
Country2Good
Country2Good
Country2Good
Country2Bad
Country2Bad

 

Thanks

 

Best Regards,

Mohamed

1 ACCEPTED SOLUTION
Ashish_Mathur
Super User
Super User

Hi,

Drag Country to the Table visual.  Write these measures

Measure = countrows(Data)

Measure1 = calculate([Measure],Data[Column2]="Good")

Measure2 = divide([Measure],[Measure1])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

Drag Country to the Table visual.  Write these measures

Measure = countrows(Data)

Measure1 = calculate([Measure],Data[Column2]="Good")

Measure2 = divide([Measure],[Measure1])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1676694047073.png

 

Jihwan_Kim_1-1676694171389.png

 

 

Expected result measure: =
VAR _allconditioncount =
    COUNTROWS ( Data )
VAR _goodconditioncount =
    CALCULATE ( COUNTROWS ( Data ), Data[Condition] = "Good" )
RETURN
    IF (
        HASONEVALUE ( Country[Country] ),
        DIVIDE ( _goodconditioncount, _allconditioncount )
    )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Thank you very much! one question please, how did you create table country? When I am going to the source I am getting this, not really able to translate to my dataset

= Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45Wcs4vzSspqlTSAbLyUjJLMvPzlGJ14OKGQAn3/PwUYsScElGEjLAoo1QMixVgoVgA", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"(blank)" = _t, #"(blank).1" = _t])

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors