Forum Discussion

Himaja95's avatar
Himaja95
Helper I
3 years ago
Solved

Power Bi

Hi Everyone,   I made a stacked bar graph (CHART1) and intended to show a trend line till 2040, which isn't appearing on this bar graph.So I modified the graph (CHART 2) and enabled the trend line....
  • kpost's avatar
    3 years ago

    Make it a "line and stacked column" chart, then create a measure using slope intercept form and the YEAR as the x value... ( y = mx + b )  where :


    M is the slope calculated by using the points (2016, 22000) and (2040, 0), or -916.67.


    I did the math and got this as your line measure based on an initial value of 22000 in 2016 and going to 0 in 2040


    sloped line = -916.67*distinct(Date_Table[Year]) + 1870000

    You can then format the line's style to make it a dashed line .

    line.