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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

M scripting conventions (suggestions)

Dear all,

 

I was wondering if anyone had any thoughts about M scripting conventions that works for them. I am just trying to work out a systematic way forward for myself.

 

I am thinking.

 

variables (ie. lists and scalar values) = camelCase (with lowercase first letter)

User defined functions = CamelCase (with uppercase first letter)

Names of Tables and other objects imported from databases = same name as they appear in the database

Fields in tables = First word uppercase and all words lowercase afterward

Names of Queries involved in intermediate processing (do not appear in the report) = lowercase_with_underscore_separator

Names of Queries that appear in the report view = Every First Letter Of Words In Uppercase 

 

I should add

Constants = ALL_UPPERCASE_WITH_UNDERSCORE

 

3 REPLIES 3
hugoberry
Responsive Resident
Responsive Resident

Because it is hard to collaborate on the Power Query scripts, there is little need agree on code name conventions. In my experience I'm trying to adhere to the rules that you mention in your post, but I think that a more authoritative input from @MSFT would be more desirable. Something in the lines of what Fsharp has would be good: http://fsharp.org/specs/component-design-guidelines/

v-sihou-msft
Microsoft Employee
Microsoft Employee

@Anonymous

 

I still can't understand your requirement. Can you share your expected result with sample data?

 

Regards,

Anonymous
Not applicable

Hi no requirements,

 

I was just wondering if people have any conventions that they use in how they label variables, names of tables, names of queries nad so forth

 

Helpful resources

Announcements
October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors