Forum Discussion

wskallmeyer's avatar
wskallmeyer
Icon for Advocate II rankAdvocate II
9 years ago
Solved

How to load m file from a text file

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 ch...
  • dkay84_PowerBI's avatar
    dkay84_PowerBI
    9 years ago

    Use the following code:

     

    let
        Source = Text.FromBinary(File.Contents("C:\Mcode.txt")),
        Expression = Expression.Evaluate(Source, #shared)
    in
    Expression