Forum Discussion

Julia_Mav's avatar
Julia_Mav
Icon for Helper II rankHelper II
3 years ago
Solved

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.

  • Anonymous's avatar
    Anonymous
    3 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

  • Anonymous's avatar
    Anonymous
    Not 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

  • daXtreme's avatar
    daXtreme
    Icon for Solution Sage rankSolution 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.

  • 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.