Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Lutinho
Frequent Visitor

Load external code from .txt for custom column

Good afternoon community,

 

I have a problem that I am trying to solve. I have a bit of code (for a custom column) that is quite critical for our reporting but which is also annoying to maintain in 6 different reports.

 

With the help of a blogpost (https://blog.crossjoin.co.uk/2014/02/04/loading-power-query-m-code-from-text-files/) I tried to load the code for the custom column externally, but without results. 

 

The point is, I am only trying to load the code for a custom code externally, not all content of the advanced editor. 

 

When creating the custom column I tried code like this:
Expression.Evaluate(Text.FromBinary(Web.Contents("https://xxxxx.xxxx.x.xxx/Subvlak.txt")))

 

Where Subvlak.txt is just a plain .txt with content like this: 

if [Modul] = "035" or ([Modul] = "022" and [#"HPG-Code"] = "003") then "Datacenter" else "Blabla"

 

I then get an error like this: 

Expression.Error: There is an unknown identifier. Did you use the [field] shorthand for a _[field] outside of an 'each' expression?

 

Anyone can help me with this? Thanks in advance!

 

With kind regards,

Lutijn

 

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @Lutinho

 

It's a cool idea. I'm afraid it's beyond my scope at present. Hope more people can see this post and give suggestions here. 

 

Best Regards,
Community Support Team _ Jing

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.