Forum Discussion
Secondary Y axis not working
Hello all,
I am trying to build a simple line graph that shows two y axis - Actual & Plan (see the picture attached). However, when I am trying to add the Plan value in the secondary y-axis, it does not let me drag the values into it. The only way how it works it is to remove the Legend. But I need to have the Legend too. Is it something how I can add a secondary Y axis on a line chart with Legend?
Thanks in advance for your help.
- Anonymous3 years ago
Hi Julia_Mav ,
I created some data:
If you use legend, you cannot add the secondary values.
You can choose different visuals, such as Line and clustered column charts, with one Value displayed as a bar chart and one Value displayed as a line chart.,
Another approach is to create a separate measure for each value in the Legend field.
Create measure.
MeasureA_Amount = SUMX(FILTER(ALL('Table'),'Table'[Group]="A"&&'Table'[Date]=MAX('Table'[Date])),[Amount])MeasureA_Amount2 = SUMX(FILTER(ALL('Table'),'Table'[Group]="A"&&'Table'[Date]=MAX('Table'[Date])),[Amount2])MeasureB_Amount = SUMX(FILTER(ALL('Table'),'Table'[Group]="B"&&'Table'[Date]=MAX('Table'[Date])),[Amount])MeasureB_Amount2 = SUMX(FILTER(ALL('Table'),'Table'[Group]="B"&&'Table'[Date]=MAX('Table'[Date])),[Amount2])Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
5 Replies
- AnonymousNot applicable
Hi Julia_Mav ,
I created some data:
If you use legend, you cannot add the secondary values.
You can choose different visuals, such as Line and clustered column charts, with one Value displayed as a bar chart and one Value displayed as a line chart.,
Another approach is to create a separate measure for each value in the Legend field.
Create measure.
MeasureA_Amount = SUMX(FILTER(ALL('Table'),'Table'[Group]="A"&&'Table'[Date]=MAX('Table'[Date])),[Amount])MeasureA_Amount2 = SUMX(FILTER(ALL('Table'),'Table'[Group]="A"&&'Table'[Date]=MAX('Table'[Date])),[Amount2])MeasureB_Amount = SUMX(FILTER(ALL('Table'),'Table'[Group]="B"&&'Table'[Date]=MAX('Table'[Date])),[Amount])MeasureB_Amount2 = SUMX(FILTER(ALL('Table'),'Table'[Group]="B"&&'Table'[Date]=MAX('Table'[Date])),[Amount2])Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Kabeerkhan0077New Member
which line chart you are using? can we plz attach it as well
- Kabeerkhan0077New Member
And please make sure you "Plan" value should be in integer value
- daXtreme
Solution Sage
If a visual does not let you drag a field into it, it means you can't do it because there's a problem with the field. It may be - usually is - that the data type of the field is not right.
- Saurabh1984New Member
First remove the legend. Remove the X-Axis date. Put the value first in primary Y axis then Secondary Y axis and then put Date. See if that works.