Implementing linear regression in Power BI

แชร์
ฝัง
  • เผยแพร่เมื่อ 29 ธ.ค. 2024

ความคิดเห็น • 30

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

  • @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 ปีที่แล้ว +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?

  • @Bharath_PBI
    @Bharath_PBI ปีที่แล้ว +3

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

  • @mnedix
    @mnedix 2 หลายเดือนก่อน +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 4 หลายเดือนก่อน

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

  • @info2satish
    @info2satish ปีที่แล้ว +1

    Awesome sir 😊

  • @alvarorodriguezlasso
    @alvarorodriguezlasso ปีที่แล้ว

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

  • @Wzxxx
    @Wzxxx ปีที่แล้ว +2

    Great explanation. My brain is back to statistics

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

  • @johansantacruz6464
    @johansantacruz6464 ปีที่แล้ว +1

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

    • @CaptBlaubaer
      @CaptBlaubaer 4 หลายเดือนก่อน

      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.

  • @behrad9712
    @behrad9712 ปีที่แล้ว +1

    Thank you so much!

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

  • @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 11 หลายเดือนก่อน

    Does LINESTX still not work for polynomial regression?

    • @SQLBI
      @SQLBI  11 หลายเดือนก่อน

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

    • @kopite833
      @kopite833 11 หลายเดือนก่อน

      @@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  11 หลายเดือนก่อน

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

  • @khaoulaanoussi7709
    @khaoulaanoussi7709 6 หลายเดือนก่อน +1

    Thank youuuuuuuuuu*

  • @lukeminikoski
    @lukeminikoski ปีที่แล้ว +1

    It blown my mind! 🥲

  • @anindadatta164
    @anindadatta164 3 หลายเดือนก่อน +1

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