Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
How work this function?
=Excel.CurrentWorkbook()
Which is current workbook? I always got emtpy fields
Do i need specify any workbook name and path?
Do it take everithing from Activeworkbook?
Hi
I do this on my desktop PC and use two options:
The one is a table and the other a named range as source.
They both work on my local machine.
When I upload to SharePoint and Refresh All, the table based one works perfectly, but the named range based one give "key do not match any rows in the table error.
I open the file obviously using Excel For the Web.
Why is it able to use table and range name as source on my esktop, but on the weg, it gives error with the named range version?
Totally in the dark here....
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.
Regards,
Xiaoxin Sheng
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.
Regards
Miguel Félix
Proud to be a Super User!
Check out my blog: Power BI em PortuguêsHi @Analitika
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)
@Analitika
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. https://support.microsoft.com/en-us/office/power-query-overview-and-learning-ed614c81-4b00-4291-bd3a...
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.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
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.
www.excelwithallison.com
@Analitika , See if this script help
let
path = Excel.CurrentWorkbook(){[Name="lstFile"]}[Content]{0}[Column1],
Source = Excel.Workbook(File.Contents(path), true)
in
Source
Check if this can help
https://radacad.com/get-data-from-multiple-excel-files-with-different-sheet-names-into-power-bi
@Analitika Probably a good question for @ImkeF , @edhans and @HotChilli
My Excel queries generally look like this though:
let
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}})
in
#"Changed Type"
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
113 | |
97 | |
85 | |
70 | |
61 |
User | Count |
---|---|
151 | |
121 | |
104 | |
87 | |
67 |