Forum Discussion
Combine Table & Stacked Bar Chart
I didnt see 'Data bar' option in the Matrix visual. is this introduced in the latest version? I'm using quite old version for now.
2.71 (July 2019 Version) - Have to upgrade
Please find below the sample data. There is a custom column created for Age Group.
| Approver | count of projects | Average of Duration | %3 Days Outstanding |
| a1 | 23 | 23 | 100% |
| a2 | 1 | 102 | 100% |
| a3 | 2 | 1 | 0% |
| a4 | 4 | 68 | 100% |
| a5 | 1 | 8 | 100% |
| a6 | 1 | 23 | 100% |
| a7 | 11 | 8 | 100% |
| a8 | 22 | 10 | 100% |
| a9 | 4 | 1 | 0% |
| a10 | 7 | 19 | 100% |
| a11 | 13 | 76 | 100% |
| a12 | 1 | 102 | 100% |
| a13 | 19 | 46 | 95% |
| a14 | 141 | 39 | 75% |
| a15 | 2 | 37 | 50% |
| a16 | 9 | 69 | 100% |
| a17 | 6 | 23 | 33% |
| a18 | 1 | 81 | 100% |
| a19 | 1 | 3 | 0% |
Anonymous - It is under Conditional Formatting oddly enough.
- Anonymous6 years agoNot applicable
Yes, I Can see that option, but it looks like it will not fulfil my requirement.
- Greg_Deckler6 years ago
Community Champion
OK this was what I was able to pull together. It's rough and needs work. I couldn't understand how the Age Group column factored in to this so I just kind of went with some data. I'll give you the code. It "works", it's not what I would call pretty. Attached a PBIX but you won't be able to open it unless you upgrade to April 2020.
SVG Stacked Data Bar = VAR __Table = 'Table' VAR __Total = MAX('Table'[Average of Duration]) + MAX('Table'[count of projects]) VAR __Color1 = IF(MAX('Table'[Average of Duration]) > MAX('Table'[count of projects]),"Red","Green") VAR __Color2 = IF(MAX('Table'[Average of Duration]) > MAX('Table'[count of projects]),"Green","Red") VAR __Min = MIN(MAX('Table'[Average of Duration]),MAX('Table'[count of projects])) VAR __ShapeWidth2 = __Min / __Total * 500 VAR __header = "data:image/svg+xml;utf8," & "<svg xmlns='http://www.w3.org/2000/svg' x='0px' y='0px' width='" & "500" & "' height='210'>" VAR __footer = "</svg>" VAR __shapeTextSquare1 = "<polygon points=""0,200 " & "500" & ",200 " & "500" & ",0 0,0"" style=""fill:" & __Color1 & ";stroke:" & __Color1 & ";stroke-width:0;fill-rule:evenodd;"" />" VAR __shapeTextSquare2 = "<polygon points=""0,200 " & __ShapeWidth2 & ",200 " & __ShapeWidth2 & ",0 0,0"" style=""fill:" & __Color2 & ";stroke:" & __Color2 & ";stroke-width:0;fill-rule:evenodd;"" />" VAR __SVG = __header & __shapeTextSquare1 & __shapeTextSquare2 & __footer RETURN __SVG- Anonymous6 years agoNot applicable
I'm sorry the underlying data used to derive the table report as below.
Approver ProjectID Duration a1 p1 2 a1 p2 4 a1 p3 10 a2 l1 1 a2 l2 1 a2 l3 1 a3 f1 15 a3 f2 15 a3 f3 20 a3 f4 20 projects>3 days = IF (my[Duration] >3, 1, 0)
count of projects = DISTINCTCOUNT(my[ProjectID])%3 Days Outstanding = SUM(my[projects>3 days])/[count of projects]Age Group = IF(my[Duration] <= 3, "<=3 Days",IF (my[Duration] >3 && my[Duration] < 6,"> 3 and < 6 Days",">=6 Days"))