Forum Discussion

eurenergy's avatar
eurenergy
Frequent Visitor
2 years ago

How to avoid using "hard coded" column names in my M code?

Hi all,

 

I recently spoke with a consultant who is very proficient in using Power BI. He mentioned that his #1 rule was to avoide using hard coded column names in his M code. I understand what he means as Power BI is very sensitive when it concerns column names.

 

But how can this be a #1 rule when I think its best to use column names when doing something as simple as changing the data types? You have to adjust data types at some point and by doing that you already have hard coded column names in your M code.

 

Kind regards,

1 Reply