Implementing linear regression in Power BI

Поделиться
HTML-код
  • Опубликовано: 25 янв 2025

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

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

    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!

  • @DK-dc1mc
    @DK-dc1mc 5 дней назад +1

    Very useful. Saved my day

  • @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

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

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

  • @ekaterinap.1060
    @ekaterinap.1060 Год назад +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?

  • @mnedix
    @mnedix 3 месяца назад +1

    Thank you for this useful tutorial. Quick question: what would be the syntax for LINESTX if I want to filter the initial table? For example, in my table I have multiple product categories and I want calculate only for one of them. Would the formula become as below (assuming I am interested in Bikes)?
    Table 3 = LINESTX
    (FILTER('Table','Table'[Category]="Bikes"),'Table'[Revenue],'Table'[Sold date],TRUE)

  • @gracechik2961
    @gracechik2961 5 месяцев назад

    How about if I want to calculate for multiple products on the same plots?

  • @SimonZimmermann82
    @SimonZimmermann82 11 дней назад +1

    Thanks so much! That MS is still not (2025) implementing an automatic display of the formula is really annoying... MS Excel had this for years or decades even

  • @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.

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

    What about polynomial regression ? Is it possible?

  • @Wzxxx
    @Wzxxx Год назад +2

    Great explanation. My brain is back to statistics

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

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

    • @CaptBlaubaer
      @CaptBlaubaer 5 месяцев назад

      Surprisingly not expensive at all. I thought the same, let it calculate for a maximum of 83.246 days on the x-axis and couldn't noticed a lag when slicing the years.

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

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

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

    Awesome sir 😊

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

    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  Год назад +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 Год назад

    Does LINESTX still not work for polynomial regression?

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

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

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

      @@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  Год назад

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

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

    Thank you so much!

  • @khaoulaanoussi7709
    @khaoulaanoussi7709 7 месяцев назад +1

    Thank youuuuuuuuuu*

  • @anindadatta164
    @anindadatta164 4 месяца назад +1

    Quite complicated, it is much easier to take the data back to excel or python and make the regression line

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

    It blown my mind! 🥲

  • @surviving101
    @surviving101 5 дней назад

    terrible explanation