Forum Discussion
Anonymous
1 year agoNot applicable
How to Create This Progress Table in Power BI?
Hi everyone, I need to create a table includes: A goal description at the top. Overall progress percentage. Number of tasks. Status and responsible person. A detailed task breakdown with: Tas...
- 1 year ago
Hi Anonymous
You can use a table visual. For the progress bar, you can generate an SVG image using DAX.
ProgressBar = VAR Percentage = SELECTEDVALUE(Progressbar[ Progress ]) * 100 // Dynamic percentage VAR BarColor = "#3498db" // Bar color VAR BorderColor = "black" // Border color VAR BorderWidth = 1 // Border width VAR Width = 150 // Total width VAR Height = 25// Bar height (Adjusted to align) VAR CellHeight = 40 // Adjust for vertical centering VAR BarWidth = DIVIDE(Percentage * (Width - (2 * BorderWidth)), 100) // Ensure it fits inside the border VAR SVG = "data:image/svg+xml;utf8," & "<svg width='" & FORMAT(Width, "0") & "' height='" & FORMAT(CellHeight, "0") & "' viewBox='-1 -1 " & FORMAT(Width + 2, "0") & " " & FORMAT(CellHeight + 2, "0") & "' xmlns='http://www.w3.org/2000/svg'>" & // Centering using transform attribute "<g transform='translate(0, " & FORMAT((CellHeight - Height) / 2, "0") & ")'>" & // Border rectangle "<rect x='" & FORMAT(BorderWidth / 2, "0") & "' y='" & FORMAT(BorderWidth / 2, "0") & "' width='" & FORMAT(Width - BorderWidth, "0") & "' height='" & FORMAT(Height, "0") & "' fill='white' stroke='" & BorderColor & "' stroke-width='" & FORMAT(BorderWidth, "0") & "' />" & // Filled progress bar "<rect x='" & FORMAT(BorderWidth, "0") & "' y='" & FORMAT(BorderWidth / 2, "0") & "' width='" & FORMAT(BarWidth, "0") & "' height='" & FORMAT(Height - BorderWidth + 0.8, "0") & "' fill='" & BarColor & "' />" & "</g>" & // Close group "</svg>" RETURN SVGMake sure to categorize it as an image url. You can use AI to generate a DAX SVG image like I did.
Please see the attached sample pbix.
danextian
Super User
1 year agoHi Anonymous
You can use a table visual. For the progress bar, you can generate an SVG image using DAX.
ProgressBar =
VAR Percentage = SELECTEDVALUE(Progressbar[ Progress ]) * 100 // Dynamic percentage
VAR BarColor = "#3498db" // Bar color
VAR BorderColor = "black" // Border color
VAR BorderWidth = 1 // Border width
VAR Width = 150 // Total width
VAR Height = 25// Bar height (Adjusted to align)
VAR CellHeight = 40 // Adjust for vertical centering
VAR BarWidth = DIVIDE(Percentage * (Width - (2 * BorderWidth)), 100) // Ensure it fits inside the border
VAR SVG =
"data:image/svg+xml;utf8," &
"<svg width='" & FORMAT(Width, "0") & "' height='" & FORMAT(CellHeight, "0") &
"' viewBox='-1 -1 " & FORMAT(Width + 2, "0") & " " & FORMAT(CellHeight + 2, "0") &
"' xmlns='http://www.w3.org/2000/svg'>" &
// Centering using transform attribute
"<g transform='translate(0, " & FORMAT((CellHeight - Height) / 2, "0") & ")'>" &
// Border rectangle
"<rect x='" & FORMAT(BorderWidth / 2, "0") & "' y='" & FORMAT(BorderWidth / 2, "0") & "' width='" & FORMAT(Width - BorderWidth, "0") & "' height='" & FORMAT(Height, "0") &
"' fill='white' stroke='" & BorderColor & "' stroke-width='" & FORMAT(BorderWidth, "0") & "' />" &
// Filled progress bar
"<rect x='" & FORMAT(BorderWidth, "0") & "' y='" & FORMAT(BorderWidth / 2, "0") & "' width='" & FORMAT(BarWidth, "0") & "' height='" & FORMAT(Height - BorderWidth + 0.8, "0") &
"' fill='" & BarColor & "' />" &
"</g>" & // Close group
"</svg>"
RETURN SVG
Make sure to categorize it as an image url. You can use AI to generate a DAX SVG image like I did.
Please see the attached sample pbix.