Forum Discussion

earlenereid's avatar
earlenereid
Frequent Visitor
9 years ago
Solved

Trend line when x-axis is text field

I would like to add a trendline to a stacked column chart.  The x-axis is a text field which displays the year/month formatted as YYYY-MM.  I am able to add a Constant line, but not a trend line.  Ex...
  • mdannemiller's avatar
    9 years ago

    It doesnt appear that you can because power bi doesnt know how to order them chronologically.  I'd make another column which creates a date from that column 

     

    NewDate = DATE(LEFT([Date],4), RIGHT([Date],2), 1) or similar which will give you a date which is the first day of each month.