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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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