March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
I am currently using Power BI Desktop without the publishing service. Basically just sharing pbix files. I would like to pull the M code out my pbix file so it is one less thing the end user can change.
I basically cut and paste the current file's M code and put in a txt file on my desktop alongside (eventually will be in a protected file share) with pbix file.
I then put that text file on my c:\.
I get an error when attempting to apply & close the query editor with the pbix file. The error as best I can tell is generic and not defined anywhere.
What am I missing?
Thanks in advance.
Cheers, Scott
Solved! Go to Solution.
Use the following code:
let Source = Text.FromBinary(File.Contents("C:\Mcode.txt")), Expression = Expression.Evaluate(Source, #shared) in Expression
What is the error message?
You should be able to copy the M code (right click your highlighted queries in the query editor and select Copy) and paste to a text file. Not sure why that would be causing an error when you try to close the query editor.
Sorry should have included this part as well. Is this correct?
let
Source = Text.FromBinary(File.Contents("C:\Mcode.txt"))
in
Use the following code:
let Source = Text.FromBinary(File.Contents("C:\Mcode.txt")), Expression = Expression.Evaluate(Source, #shared) in Expression
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
127 | |
85 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |