"Translation" of Excel formula into M language for the Power Query Editor

lasse0hlsen

New Member
Joined
Feb 1, 2020
Messages
5
Office Version
  1. 365
Platform
  1. Windows
Hi guys,

I am totally new to Power BI, the Power Query Editor and most of all the M language. I wanna try to import data from different Excel documents using the Power Query Editor and then merge different columns from these separate documents using the joins function. Finally, I plan to add another custom column to this merged table with a formula that refers to a sheet in another Excel document. My main difficulty for now is that I am not able to "translate" the following formula into the M language:

=IFNA(VLOOKUP(A2,'Implementing Organisations'!A2:B6, 2,FALSE), "unassignable")

Under the following link you can find a dummy Excel document, which basically shows what I am trying to do with the custom column function in the Power Query Editor (once I have managed to merge the two columns from the other Excel docs): Excel formula to be translated into M language.xlsx. You can see that the Excel workbook contains two different worksheets: The first one is titled "Sample data" and it contains the above-mentioned formula in column B. The formula compares the spelling of the organisations in column A with a pre-defined list of deviating and obligatory spellings in the worksheet "Implementing Organisations" - if the name of the organisation is incomplete the formula will automatically complete/correct the spelling of the name (provided that the correct name of the organisations is included in the list in the "Implementing Organisations" worksheet). Now here's my actual question: Could someone of you please explain to me how I could add a custom column with the this formula into my table in the Power Query Editor (see screenshot below)? I believe that my main difficulties are that in the M language there does not exist a function such as the IFNA function and that the formula refers to another Excel worksheet ("Implementing Organisations"), which is not part of the current query that I have created...

image.png


I look forward to your answers and want to thank you in advance for your help!
:slightly_smiling_face:


Best,
lasse0hlsen
 

Excel Facts

Waterfall charts in Excel?
Office 365 customers have access to Waterfall charts since late 2016. They were added to Excel 2019.

Forum statistics

Threads
1,214,833
Messages
6,121,868
Members
449,053
Latest member
Mesh

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top