Forum Discussion
Anonymous
6 years agoNot applicable
Line chart with total as a Legend
Hi, Is it possible to show a total of sales as a legend in line chart? I have got a dataset that contains Product(A,B,C), Date(2006,2007,2008) and Quantity(10,20,30) columns , Currenlty I'm g...
Anonymous
6 years agoNot applicable
v-xuding-msft , I want to have a total as a seperate line aloging with other category, plesae see the below fig: I draw the red line which i need to get in the chart.
Thank you,
v-xuding-msft
6 years agoCommunity Support
Hi Anonymous ,
There is a limitation for this scenario. After draging column into the "Legend" field, we can only add one value into "Value" field. For your request, we can't add another column or measure about total values when we have put the "Product" column into "Legend" Field. There are two workarounds that you could try.
- If there are not many products in your table, you could create measures per products to show them.
a = CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[Product] = "a"))
b = CALCULATE(SUM('Table'[Amount]),FILTER('Table','Table'[Product] = "b"))
Total = CALCULATE(SUM('Table'[Amount]),ALL('Table'[Product]))
- If there are many products, please try to use a slicer to filter per products
Measure = CALCULATE(SUM('Table'[Amount]),ALLSELECTED('Table'[Product]))
Total = CALCULATE(SUM('Table'[Amount]),ALL('Table'[Product]))
Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.