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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
AD_SNOW
Helper I
Helper I

Donut background issue in svg

Team,

I'm trying to build a donut in PBI Table. I'm using this code to do so. However, as per the blog, >= 100% shows full solid circle with tick mark inside. However, I don't want to show tick. Even for 100% and greater I want percentage to display.

I tried this code.

Pie Chart SVG = 
var PercentValue = IF([%Change] >.9999, [%Change], [%Change] ) var PercentA = PercentValue * 360 
var CirclePercent = 180 - PercentA var ShortDistance = if(CirclePercent < 0, 1,0) var Radians = RADIANS(CirclePercent) var XArcEnd = sin(Radians) var YArcEnd = cos(Radians) 
var circle = IF(PercentValue = 1, "<circle cx='0' cy='0' r='1' fill='green' />", IF(PercentValue > 1, "<circle cx='0' cy='0' r='1' fill='red' />", "<circle cx='0' cy='0' r='0.8' fill='white' />")) 
var textvalue = IF(PercentValue >= .9999, "<text x='0' y='0' font-size='0.6' alignment-baseline='middle' text-anchor='middle' fill='white'>"&FORMAT(PercentValue,"0%")&"</text>", "<text x='0' y='0' text-anchor='middle' alignment-baseline='middle' font-size='0.6'>"&FORMAT(PercentValue,"0%")&"</text>") 

RETURN 

"data&colon;image/svg+xml;utf8,<svg 
xmlns='http://www.w3.org/2000/svg' 
viewBox='-1 -1 2 2'> 
<circle cx='0' cy='0' r='1' fill='lightgrey' /> 
<path d='M 0 -1 A 1 1 0 " & ShortDistance & " 1 " & XArcEnd & " " & YArcEnd & " L 0 0 z' fill='green'></path>"& 
circle&textvalue&" 
</svg>"

for one of the rows (marked) I'm getting extra outer green color

Screenshot 2023-06-16 at 7.11.32 PM.png

 

not sure from where I'm getting this. Can @KerKol please help me fixing this?

 

Thanks!

0 REPLIES 0

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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