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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
neilmacmullen
Frequent Visitor

What do I need to do to make a custom function appear in the DAX dropdown list

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?)

1 ACCEPTED SOLUTION
ImkeF
Community Champion
Community Champion

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

View solution in original post

3 REPLIES 3
garythomannCoGC
Impactful Individual
Impactful Individual

Custom (Reusable) DAX Function   please vote :}

ImkeF
Community Champion
Community Champion

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 🙂 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

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.