Forum Discussion
Dynamic Reference Lines in Legend
I'm using a line chart. Thanks for your input. However (this comment is more directed to Power BI developers), having to create a measure for the average in order for it to show in the legend takes away from the convenience of using dynamic reference lines. Convenience is especially relevant for users like myself who don't have a developer/coding background to build measures on the fly.
In Power BI Dekstop, the line chart can't generate dynamic average lines automatically. Anonymous is correct. In a line chart, one line means a field, so to include average line, you have to create average field in your dataset (either calculated column or measure). And it can't be a dynamic aggregation type. You need to define it in your formula. To create an average measure, please refer to formula below:
Average Amount = CALCULATE(AVERAGE(Table1[Amount]),ALL(Table1))
Regards,