Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi, this is a general question about the DAX language as I can use it in Power BI:
Can I, as a user, define/create/reuse new functions in a Power BI report? I'm often in the situation that parts of several measures could be abstracted into a shared function. This is easy to do in M (Power Query) but I don't see any way to do this in DAX.
Solved! Go to Solution.
Hi @Chris12,
It seems that we cannot define a reusable dax expression in Power BI currently.
You could vote this idea here which has been submitted in Power BI ideas forum and add your comments there to improve Power BI and make this feature coming sooner.
Best Regards,
Cherry
It only took 7 years to MS to deliver this kind of functionality. (private preview). what.a.joke.
Just as a reference, if anyone searches for this problem and comes to this post as I did..
my way of simulating this kind of functions is creating DAX measures always using variables like that:
CustomColumn =
// define the parameters and where to get their values
var param_startdate = related('abc'[abc])
var param_enddate = 'xyz'[xyz]
// the actual function goes here
return datediff(param_startdate,param_enddate,MINUTE)
that way I created a little library for my own reference where I can quickly find such functions and can easily reuse them.
Thanks. However, do I understand correctly that the reuse happens via copy & paste?
Unfortunately yes, thats true. From a code maintenance perspektive that is a bad practise, I know. But its the only solution I can imagine for using standardized custom dax formulars with parameters.
Hi @Chris12,
It seems that we cannot define a reusable dax expression in Power BI currently.
You could vote this idea here which has been submitted in Power BI ideas forum and add your comments there to improve Power BI and make this feature coming sooner.
Best Regards,
Cherry
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
72 | |
71 | |
37 | |
31 | |
26 |
User | Count |
---|---|
92 | |
50 | |
44 | |
40 | |
35 |