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!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
I have created a new power-query function by selecting Home->Edit Queries->New Source->Blank Queries->Advanced Editor.
The function shows up in the query list and I can invoke it from the query editor.
I then click "close and apply"
I was expecting the newly named function to then appear amongst the DAX dropdown/intellisense list when creating a new calculated column or measure but it doesn't. If I write the name of the function in the expression, I just get a syntax error.
Am I missing a step? None of the custom function tutorials I've found show a new function being invoked from the main application - is it even possible? (I'm not sure how you would be able to write reusable functions without this though?)
Solved! Go to Solution.
Custom functions are created using the M-language and can only be used in the query editor (where the M-language is used).
You cannot write custom functions in/for DAX.
This video shows how to reuse M-functions: https://www.youtube.com/watch?v=6TQN6KPG74Q
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Custom functions are created using the M-language and can only be used in the query editor (where the M-language is used).
You cannot write custom functions in/for DAX.
This video shows how to reuse M-functions: https://www.youtube.com/watch?v=6TQN6KPG74Q
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Thanks Imke. I'd worked out that M and custom functions were probably the way to go to solve my _actual_ problem (https://community.powerbi.com/t5/Desktop/Working-with-time-based-IOT-data-in-PowerBi-advice-needed/m...) but was clearly suffering a major misunderstanding in thinking that power queries were also a way of extending the set of operations available in the DAX editor in the report view. It seems very odd not to have some way of providing resuable code/patterns in the report view - it seems that once I start writing M code I'll be forever relegated to the query-editor. 😞
Anyway, thanks for the video link - I'll definitely check out the blog and the repo looks like an excellent reference source for someone trying to learn M.
Even though this is not the answer I was hoping to hear, I'll mark it as a solution 🙂
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.