Showing results for 
Search instead for 
Did you mean: 
Post Prodigy
Post Prodigy


How work this function?


 Which is current workbook? I always got emtpy fields

Do i need specify any workbook name and path?

Do it take everithing from Activeworkbook?

Community Support
Community Support

Hi @Analitika,

In fact, there are a few differences between excel and power bi and correspond Dax/m query formula. (it probably related to excel/ power bi data models, mechanism, and backend processing)
As MFelix said, the function that you mentioned seems like required some global variables that excel provided so it can't work properly on the power bi side.

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Super User
Super User

Hi @Analitika ,


This is a function expression so it does not expect any parameters. If you leave has is it will give you am option to invoke the function that will get all the tables ni the excel file (if you do not have any tables this will return an empty table).


If you know the exact table name you need you can change this syntax by adding the name of the table something similar to:


= Excel.CurrentWorkbook(){[Name="TableName"]}[Content]



This will invoke the table and you will get the information without the need of addittional steps.


Miguel Félix

Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português

@MFelix  from which excel file?

Community Champion
Community Champion

Hi @Analitika 

CurrentWorkbook is the workbook you're in and using Power Query. Power Query lists in a dialog all the items in this current workbook that are in this workbook.
With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

@FrankAT   but im not in workbook im in PBI desktop

Community Champion
Community Champion

Hi @Analitika 

so you can't use this function!

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

You can use M code in Power Query in Excel as well as in Power BI. When you use Power Query in Excel, you can use the Excel.CurrentWorkbook function.


As @MFelix  said, here is an example of the 'Source' step when I click the 'From Table' button in the 'Data' tab in the ribbon in Excel and use an Excel table as the source for my query: 

= Excel.CurrentWorkbook(){[Name="Table1"]}[Content]


This says, look for Table1 in the current workbook (same workbook as the report is being built using Power Query).


If you're using Power BI your Source step might look more like @Greg_Deckler 's example.

Please @mention me in your reply if you want a response.

Check out my Tokyo 2020 report with live stats - KUDOS much appreciated

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.

Super User
Super User

@Analitika , See if this script help


    path = Excel.CurrentWorkbook(){[Name="lstFile"]}[Content]{0}[Column1],
    Source = Excel.Workbook(File.Contents(path), true)


 Check if this can help

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin

Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
Super User
Super User

@Analitika Probably a good question for @ImkeF , @edhans  and @HotChilli 


My Excel queries generally look like this though:

    Source = Excel.Workbook(File.Contents("C:\Users\gdeckler\Downloads\ItemUnit.xlsx"), null, true),
    Ancilliary_Table = Source{[Item="Ancilliary",Kind="Table"]}[Data],
    #"Changed Type" = Table.TransformColumnTypes(Ancilliary_Table,{{"Item no", Int64.Type}, {"Product Description", type text}, {"Qty", Int64.Type}, {"Sale", type text}, {"Attribute.1", type text}, {"Value", type any}})
    #"Changed Type"

@ me in replies or I'll lose your thread!!!
Check out my External Tool for Power BI Desktop! Microsoft Hates Greg's Quick Measures
YouTube Channel! Microsoft Hates Greg
Check out my latest book!

Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

November Power BI Update 768x460.png

Check it Out!

Click here to read more about the November 2021 Updates!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.