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!To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.
Hi,
Need your kind help please, How can I calculate the % of "Good" per country?
Column1 | Column2 |
Country1 | Good |
Country1 | Good |
Country1 | Bad |
Country2 | Good |
Country2 | Good |
Country2 | Good |
Country2 | Good |
Country2 | Bad |
Country2 | Bad |
Thanks
Best Regards,
Mohamed
Solved! Go to Solution.
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.
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.
Hi,
Please check the below picture and the attached pbix file.
Expected result measure: =
VAR _allconditioncount =
COUNTROWS ( Data )
VAR _goodconditioncount =
CALCULATE ( COUNTROWS ( Data ), Data[Condition] = "Good" )
RETURN
IF (
HASONEVALUE ( Country[Country] ),
DIVIDE ( _goodconditioncount, _allconditioncount )
)
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])