Forum Discussion

Benj's avatar
Benj
New Member
10 years ago

Trend Lines

Is it possible to add trendlines to a scatter graph, like you can in Excel.

 

One example would be adding a linear trendline and being able to see the equation to get correlation coefficients.

 

Another example would just be to add a linear/exponential etc. trendline to a time series graph, giving the ability to project forward in time.

 

Thanks

 

Benj

32 Replies

  • phillip786's avatar
    phillip786
    Frequent Visitor

    Guys,

    I am new to power bi and having an issue with Trend Lines. I have a dataset that has a date column and covers about 3 years of data. When I create a Clustered Column chart using the date the first visualization shows 3 columns one for each year where you can click each to drilldown if you want to month, etc. My issue is when viewing the initial chart with years I have the Trend Line option and can turn it on but when I drill down to the Month level it goes away....I really want it at the month level so tried removing Year and quarter from the Date Hierarchy so only Month is left but in this configuration I don't even have the trend as an option.

     

    Please let me know what am I doing wrong?

    • Anonymous's avatar
      Anonymous
      Not applicable

      phillip786 as noted earlier in this thread, the x-axis must be a numeric value for trend lines to work currently. Month name is text.

      • phillip786's avatar
        phillip786
        Frequent Visitor

        Thanks for the reply...so you say that on the chart itself the category being a date type but displaying a month name which it does automatically it can't trend across that? Seems like you are saying that once I drilldown from Years I have to have the months displayed as 1,2,3,4,etc... makes no sense because if you then drilldown to days which are 1 - 30 it stil doesn't work.

        I am not using a lookup that has month names in it it is just a Date column that automatically gets the date hierarchy see below how it disappears:

         Initial chart trend okthis is the axis data a date type which converts to thisyou can see the trend line is availablethis is the view once you drilldown to quarters no trendlineno trend option at quarter leveleven when down to day level still no trend line

  • frankkinsey's avatar
    frankkinsey
    Frequent Visitor

    Oddly PowerBIs auto generated insights has this in its visuals but I can find no way of doing this with your own data. Am I doing something wrong?

  • HediSlim's avatar
    HediSlim
    Frequent Visitor

    Hello Benj,

     

    I have the same need about trend lines equations. 

     

    Did you get any responses since ?

    Maybe is there a DAX formula which could heps us ?

     

    Best regards

    • willz06jw's avatar
      willz06jw
      Helper II

      Currently, as of version 2.47.4766.801 64-bit June,2017 (and perhaps before), you can use a Date field, but NOT a Date Hierarchy to display trend lines.  

      You change this by:

      1.  Changing the 'Modeling'/'Data type' on your field to 'Date' in the 'Data' area (far left)

      2.  In 'Report' area (far left), select the object which needs to have the trend line

      3.  Add the Date as the Shared Axis (if using Line and Clustered Column Chart)

      4.  In the 'Fields' for the object, click the down arrow next to your Date shared axis

      5.  Select the field's name, and NOT Date Heirarchy

      6.  Click 'Analytics' and 'Trend Line' is suddenly available