Forum Discussion
Combine Table & Stacked Bar Chart
Greg_Deckler , I am not seeing any image now. I followed your options. I changed like Model --> Selected 'SVG' column --> Advanced --> Data Category --> Image URL
I referred few other posts here and found the issue.
data:
I changed it to data:
- Anonymous6 years agoNot applicable
Please find the mock data.
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 Calcuated Columns/Measures:
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")) - Anonymous6 years agoNot applicable
Greg_Deckler Thanks, I will review and share the details what you need in few hours.
- Anonymous6 years agoNot applicable
It is fine, but i am looking for 3 colors based on 'Age Group'. I just implemented in the actual report, but i am getting 'MAX function only accepts a column reference as the argument number 1".
- Anonymous6 years agoNot applicable
I tried my level best to bring the expected result.
SVG Stacked Data Bar =
VAR __Table = 'my'
VAR __Color1 = IF (AVERAGE(my[<3 age group])=1,"Green","Yellow") VAR __Color2 = IF (AVERAGE(my[<3 age group])=1,"Yellow","Green")
VAR __ShapeWidth2 = count(my[ProjectID])*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 applicableSVG Stacked Data Bar =VAR __Table = 'my'VAR __Color1 = IF (AVERAGE(my[<3 age group])=1,"Green") VAR __Color2 = IF (AVERAGE(my[>3 & <6 group])=1,"Yellow","Red")VAR __ShapeWidth2 = count(my[ProjectID])*500VAR __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 & __footerRETURN__SVG
i'm getting like above which is not correct.
'Age Group' is not applied, BAR length is also very small.
- Anonymous6 years agoNot applicable
Greg_Deckler , Can you look into the issue please and provide the solution?
- Greg_Deckler6 years agoCommunity Champion
It's going to be next to impossible to troubleshoot this without the data Anonymous - can you share the PBIX or a representative sample?
- Anonymous6 years agoNot applicable
Greg_Deckler , is the same data help you to bring the expected result? can you help me on this ?
- Greg_Deckler6 years agoCommunity Champion
Anonymous - Sorry, lost track of this thread. Let me take a look at the data you provided and see what I can create.
- Anonymous6 years agoNot applicable
Greg_Deckler , please let me know if you find something on this.
- Anonymous6 years agoNot applicable
Greg_Deckler , please provide an update on this.
- Anonymous6 years agoNot applicable
- Greg_Deckler6 years agoCommunity Champion
Anonymous - I have updated the PBIX file with your sample data and created the columns and measures, I think, correctly. What I need to understand is what is what in your stacked bars. If this were a normal stacked bar chart, what would be the Legend and what would be the Value??