Forum Discussion
create a bar chart with an average line running through
- 8 years ago
Hi Forrestgump,
For column chart, we can only add the measure as a Min line in the Analytics pane like this.
Measure = CALCULATE(DISTINCTCOUNT(SurveyData[id]),ALL(SurveyData))/CALCULATE(COUNTROWS(HeadcountData),ALL(SurveyData))
For more details, please check the pbix as attached.
https://www.dropbox.com/s/g56davhns5i6kt1/create%20a%20bar%20chart.pbix?dl=0
Regards,
Frank
hi Greg,
Thanks for your reply. So i am looking for the 10.8% which comes form the overall calculation:-
| SPU / Function | # Complete | Eligible Employees | Percentage |
| Function 1 | 18 | 33 | 54.5% |
| Function 2 | 14 | 35 | 40.0% |
| Function 3 | 18 | 52 | 34.6% |
| Function 4 | 1 | 3 | 33.3% |
| Function 5 | 60 | 259 | 23.2% |
| Function 6 | 72 | 336 | 21.4% |
| Function 7 | 1 | 5 | 20.0% |
| Function 8 | 51 | 275 | 18.5% |
| Function 9 | 8 | 45 | 17.8% |
| Function 10 | 95 | 535 | 17.8% |
| Function 11 | 7 | 40 | 17.5% |
| Function 12 | 41 | 247 | 16.6% |
| Function 13 | 10 | 67 | 14.9% |
| Function 14 | 66 | 489 | 13.5% |
| Function 15 | 18 | 136 | 13.2% |
| Function 16 | 18 | 141 | 12.8% |
| Function 17 | 11 | 93 | 11.8% |
| Function 18 | 11 | 108 | 10.2% |
| Function 19 | 30 | 298 | 10.1% |
| Function 20 | 14 | 149 | 9.4% |
| Function 21 | 28 | 313 | 8.9% |
| Function 22 | 3 | 34 | 8.8% |
| Function 23 | 30 | 374 | 8.0% |
| Function 24 | 34 | 428 | 7.9% |
| Function 25 | 6 | 89 | 6.7% |
| Function 26 | 58 | 867 | 6.7% |
| Function 27 | 12 | 207 | 5.8% |
| Function 28 | 29 | 573 | 5.1% |
| Function 29 | 6 | 191 | 3.1% |
| Function 30 | 4 | 137 | 2.9% |
| Function 31 | 1 | 38 | 2.6% |
| Function 32 | 5 | 190 | 2.6% |
| Function 33 | 2 | 77 | 2.6% |
| Function 34 | 7 | 368 | 1.9% |
| Function 35 | 0 | 5 | 0.0% |
| Function 36 | 0 | 17 | 0.0% |
| Function 37 | 0 | 11 | 0.0% |
| Function 38 | 0 | 7 | 0.0% |
| Total | 789 | 7272 | 10.8% |
Measure = SUM('Table'[# Complete]) / SUM('Table'[Eligible Employees])- Forrestgump8 years agoFrequent Visitor
The issue with this is that [#Complete] and [Eligible Employees] are measures not columns so this won't work i believe.
# Complete = DistinctCount(SurveyData[ID])
Eligible Employees = CountRows(HeadcountData)
- v-frfei-msft8 years ago
Community Support
Hi Forrestgump,
Here I made one sample for your reference.
1. Create the measures as you offered.
# Complete = DistinctCount(SurveyData[ID])
Eligible Employees = CountRows(HeadcountData)
2. Then create a measure using the formula and create a Line and stacked column chart to work around.
Measure = CALCULATE(DISTINCTCOUNT(SurveyData[id]),ALL(SurveyData))/CALCULATE(COUNTROWS(HeadcountData),ALL(SurveyData))
For more details, please check the pbix as attached.
https://www.dropbox.com/s/g56davhns5i6kt1/create%20a%20bar%20chart.pbix?dl=0
Regards,
Frank
- Forrestgump8 years agoFrequent Visitor
Hi Frank,
That worked great.....However the bar chart I wanted to create runs from right to left. Is there a way of achieving this?
Regards,
Forrest