Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Anonymous
Not applicable

Least squares approximation

have a poll, and I want to calculate "betas" with the last square aproxximation formula.

 

I have "Y" (satisfaction), and some other variables as "X"

 

I have a column with all values of "Y", and one column with all answers of the "X" other answers of the questios of the poll:

 

Table Name = Registers

Y    X    QuestionCode

3    3           x1

2    3           x2

4    2           x1

      3           x3

      4           x2

 

 

"X" and QuestionCode columns are bigger than "Y"column.

I want to acces with a filter on QuestionCode, and multiply Y * (all) x1

 

That is because of the part of the formula that is SUMMATORY ( X*Y ).

That is differrent of SUMMATORY (X) * SUMMATORY (Y)

 

What I have been trying is SUMX(Registers[Y] * CALCULATE(Registers, Registers[X]) and filtering on the inform sheet with the QuestionCodes, but when I filter it, it turns "zero"

1 REPLY 1
Greg_Deckler
Super User
Super User

If I understand Least Squares Approximation correctly from here:

 

http://math4all.in/public_html/linear%20algebra/chapter8.5.html

 

then you will need to do matrix multiplication. I created a Quick Measure for this:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/MMULT/m-p/630231

 

This uses a technique for Transposing tables in DAX that is documented here:

 

https://community.powerbi.com/t5/Quick-Measures-Gallery/TRANSPOSE/m-p/630229

 

Or you could use M to do that job if it does not need to be 100% dynamic.

 

 


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

Check out the June 2024 Power BI update to learn about new features.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.