Implementing linear regression in Power BI

Поделиться
HTML-код
  • Опубликовано: 1 авг 2024
  • How to manage the LINESTX function results in DAX to compute linear regression.
    Article and download: sql.bi/800442?aff=yt
    How to learn DAX: www.sqlbi.com/guides/dax/?aff=yt
    The definitive guide to DAX: www.sqlbi.com/books/the-defin...
  • НаукаНаука

Комментарии • 26

  • @Nazeerul_Hazard
    @Nazeerul_Hazard Год назад +1

    Great video, Marco! Thank you for sharing this insightful tutorial. Typically, I perform regression analysis in Python and get the coefficients and intercept into Power BI for predicting values. However, with the LINESTX function in Power BI, I can now conveniently run the regression directly within Power BI and obtain the linear equation. This approach is highly efficient, dynamic and saves me time. Thanks again for introducing this helpful technique!

  • @Wzxxx
    @Wzxxx 10 месяцев назад +2

    Great explanation. My brain is back to statistics

  • @piaveipvsenlawp7402
    @piaveipvsenlawp7402 Год назад +1

    I assumed linest stood for linear estimator- hence the function would be pronounced lin-est. Not a problem though!
    Thanks for all the great content. You guys are life savers

  • @ekaterinap.1060
    @ekaterinap.1060 10 месяцев назад +1

    Thank you for the video, Marco! It works! The question is - how to look for a linear regression for the future months where we still have no sales?

  • @info2satish
    @info2satish Год назад +1

    Awesome sir 😊

  • @behrad9712
    @behrad9712 Год назад +1

    Thank you so much!

  • @Bharath_PBI
    @Bharath_PBI Год назад +3

    Hi,
    So, for single row table the SELECTCOLUMNS() returns a scalar value, similar to VALUES().. Thank you!

  • @alvarorodriguezlasso
    @alvarorodriguezlasso Год назад

    Like, regards, from Cali Colombia. I suggest you use Excel's linear forecast function to explain this topic.

  • @johansantacruz6464
    @johansantacruz6464 Год назад +1

    Hi! How many times are we calculating the linear regression? Seems to be expensive. Thanks for this video!

  • @khaoulaanoussi7709
    @khaoulaanoussi7709 Месяц назад +1

    Thank youuuuuuuuuu*

  • @lionels839
    @lionels839 Год назад

    What about polynomial regression ? Is it possible?

  • @elrevesyelderecho
    @elrevesyelderecho Год назад

    Quick question, changing subject...any new about the issue in Bravo not running after PBI May update? Thanks.

    • @SQLBI
      @SQLBI  Год назад +1

      We just released an update - please check it and report if you have any issue on the dedicated area github.com/sql-bi/Bravo/issues

  • @brynhumberstone
    @brynhumberstone Год назад

    Once you have created the linear regression measure, how do you actually add the line to your chart?

    • @SQLBI
      @SQLBI  Год назад

      You add the measure to the chart! Look at the sample file, you can download it from the article linked in the description.

  • @lorenzocassina2538
    @lorenzocassina2538 10 месяцев назад

    Let's say I have a table with 100 products with all the Prices and Quantities. I'd like to do linear regression with many different products.
    How do I use LINESTX in a smart way, avoiding to write 100 DAX queries?
    How can I link a dropdown list of the products, located in one tab of our dashboard, to LINESTX function? Is that possible?

    • @SQLBI
      @SQLBI  10 месяцев назад +1

      The LINEST executed in a measure is automatically applied to each product if you chart them. Technically there are hundreds of executions of the function but in different filter contexts.

  • @aravindbabu4882
    @aravindbabu4882 Год назад

    Yes I'm facing the same bug issue. How to solve this

    • @SQLBI
      @SQLBI  Год назад

      Which bug?

    • @aravindbabu4882
      @aravindbabu4882 Год назад

      @@SQLBI where we cannot pick slope1 using selectcolumn

    • @SQLBI
      @SQLBI  Год назад

      Ignore the red line under the function, it's a bug of the editor in Power BI Desktop. The code works, a real error would display a message on a yellow background - that is a real error.

  • @kopite833
    @kopite833 6 месяцев назад

    Does LINESTX still not work for polynomial regression?

    • @SQLBI
      @SQLBI  6 месяцев назад

      LINE stands for linear... we should wait for a dedicated function.

    • @kopite833
      @kopite833 6 месяцев назад

      @@SQLBI LINEST in Excel works, for e.g. a 2nd order polynomial...
      Find slope and intercept coefficients with...
      LINEST(KnownY,KnownX^{1,2},,TRUE)
      Then plot line with...
      (Slope1*(KnownX^2))+(Slope2*KnownX)+Intercept
      Or 3rd order polynomial...
      LINEST(KnownY,KnownX^{1,2,3},,TRUE)
      (Slope1*(KnownX^3))+(Slope2*(KnownX^2))+(Slope3*KnownX)+Intercept
      Higher orders follow the same pattern

    • @SQLBI
      @SQLBI  6 месяцев назад

      Sorry, look at the LINESTX syntax which is more flexible:
      dax.guide/linestx/

  • @lukeminikoski
    @lukeminikoski Год назад +1

    It blown my mind! 🥲