Omaer Khan on 01 Mar 2017 02:06:50
I'd like to be able to create reusable functions in DAX, instead of using the same DAX code in multiple measures.
Example: I have some complicated DAX code, which calculates the no of working seconds between two date-times. This excludes holidays, weekends, and only counts seconds from the start of the work-day, to the end of the work-day.
I use this DAX code a lot, for many measures which need to be in "Working Time" (working hours/minutes).
I would love to not have to copy-paste a bunch of code into all of my measures, but to be able to create a reusable function instead.
- Comments (30)
RE: Custom (Reusable) DAX Function
Yes, please add to Power BI.
RE: Custom (Reusable) DAX Function
This would be awesome, however, I suspect since no one from the Power BI team or Microsoft has commented, I figure this will never happen. I freaking need it now.
RE: Custom (Reusable) DAX Function
'+1. I have a spreadsheet with only tens of custom measures and managing them all is already a nighmare.
RE: Custom (Reusable) DAX Function
This would be useful because I often need to do a linear interpolation in a measure with a What If Parameter, to shift between a min and max at a user-specified ratio. It's troublesome to repeat the linear interpolation formula and it would much easier if I could just create a Tween(min, max, ratio) function to leverage an abstract formula.
RE: Custom (Reusable) DAX Function
Would indeed be a big improvement for maintainbality and development time indeed. Im writing the same 2 formulas over and over, only difference are the ledger accounts that are being filtered.
RE: Custom (Reusable) DAX Function
It would be incredibly useful
RE: Custom (Reusable) DAX Function
Yes, please add to Power BI. This would end the long-winded DAX measures that are hard to read yet nonetheless critical for our company's reports.
Adding it to Excel's data model would be nice, too.
RE: Custom (Reusable) DAX Function
I agree wholeheartedly.
Why recreate the wheel every time you need one
RE: Custom (Reusable) DAX Function
Would be very useful and easier to do updates to a measurement (along with source control hopefully somewhere in the future)
RE: Custom (Reusable) DAX Function
Please update on this,
This will make power bi a power full tool.
need this ASAP