Forum Discussion

me418's avatar
me418
Regular Visitor
5 years ago
Solved

How to add Trend line in Line Chart

Hi

 

I've made line chart of Cost by quarter in Power BI as below.

I want to add trend line of this, but there is no Trend line item in Analytics section.

Would you please let me know how to add trend line in this chart?

Thank you. 

 

 

 

  • Anonymous's avatar
    Anonymous
    5 years ago

    me418 

    Use the date column instead of TEXT Year&Quarter on the X-axis like the following. 

     

    Then you can change the x-axis type to continuous that allows you to add a trend line.

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.

     

9 Replies

    • me418's avatar
      me418
      Regular Visitor

      Hi AmitChandak, 

       

      Yes, The line chart shows quarterly trends itself, but we need trend line which shows tendency of total quarters.  

      • Anonymous's avatar
        Anonymous
        Not applicable

        Can you please share your data and the output you need?

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi @me418 .

     

    If you want to add a trend line then you have to first change your X-Axis type to 'Continuous'.

     

    Regards,

    Sanket Bhagwat.

     

    If this post helps, then please mark it as 'Accept as Solution' so that other members could find it quickly.

     

    • me418's avatar
      me418
      Regular Visitor

      Hi Sanket Bhagwat, 

       

      Thank you for your reply.

      but if I select the X-Axis type to 'Continuous', then it's forced to change 'Categorial'.

      Is there any option that I have to choose?

      • Anonymous's avatar
        Anonymous
        Not applicable

        Can you please check the data type of your quarter column?

        If it is text, then you will need to convert it into a numeric type as trend line cannot work for text data type.

         

        Regards,

        Sanket Bhagwat

  • Anonymous's avatar
    Anonymous
    Not applicable

    me418 

    Use the date column instead of TEXT Year&Quarter on the X-axis like the following. 

     

    Then you can change the x-axis type to continuous that allows you to add a trend line.

     

     

    Paul Zheng _ Community Support Team
    If this post helps, please Accept it as the solution to help the other members find it more quickly.