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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Nie
Helper I
Helper I

Possible to Insert Actual Excel Formula in Power Query?

Is it possible to insert an actual Excel formula with Table.AddColumn() in Power Query?

 

I want to generate a new table (Table B) with 3 columns, to show correlations between the columns in Table A. For example:

Table BTable B

Fig: Table B.

 

I want the rows in the "coefficient" column to have the Excel formula =CORREL(INDIRECT("TableA[" & A2 & "]"), INDIRECT("TableA[" & B2 & "]")). I need to do this because some column rows in Table A are empty and I can't find a way to calculate correlations in M or DAX when there are empty rows.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Nie 

Check this blog:
Correlation coefficient - Microsoft Power BI Community

 

But I would recommend you to calculate the coefficient in excel then import the result table into power bi.

Vpazhenmsft_0-1627871521637.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Nie 

Check this blog:
Correlation coefficient - Microsoft Power BI Community

 

But I would recommend you to calculate the coefficient in excel then import the result table into power bi.

Vpazhenmsft_0-1627871521637.png

 

 

Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

lbendlin
Super User
Super User

"I can't find a way to calculate correlations in M"

 

What have you tried?  Usually custom generator functions can handle scenarios like these.

Transform Column using custom function in Power Query (part 2) | Excel City

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.