Forum Discussion

ashmitp869's avatar
ashmitp869
Icon for Responsive Resident rankResponsive Resident
1 year ago

Help me to get the Linear measures ?

Hi ,

How can I achieve the output of 
Linear (Drivers Licence Validation)
Linear (infringements)



Currently my report Lince and Clustured  Column Chart looks like below 

 

2 Replies

  • Hi,

    Please check the link down below, that describes about LINESTX DAX function, whether it is what you are looking for.

     

    LINESTX function (DAX) - DAX | Microsoft Learn

    Uses the Least Squares method to calculate a straight line that best fits the given data, then returns a table describing the line. The data result from expressions evaluated for each row in a table. The equation for the line is of the form: y = Slope1*x1 + Slope2*x2 + ... + Intercept.

     

     

  • Hi ashmitp869 

    In Power BI, there’s a built-in Trend line feature that you can enable from the Analytics pane in your chart.
    However, this option only works when your X-axis is set to Continuous (for example, a continuous date field).

     

    If your axis is Categorical or you’re using a Combo chart, the feature won’t be available.
    In that case, you can manually create a linear line using DAX, by calculating the linear regression  and then returning the line value for each point on the X-axis.

    More guideness by the link
    https://www.youtube.com/watch?v=IL9TsmHVyZE
    The pbix with the example of the simple version is attached

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly