Read our blogs, tips and tutorials
Try our exercises or test your skills
Watch our tutorial videos or shorts
Take a self-paced course
Read our recent newsletters
License our courseware
Book expert consultancy
Buy our publications
Get help in using our site
453 attributed reviews in the last 3 years
Refreshingly small course sizes
Outstandingly good courseware
Whizzy online classrooms
Wise Owl trainers only (no freelancers)
Almost no cancellations
We have genuine integrity
We invoice after training
Review 30+ years of Wise Owl
View our top 100 clients
Search our website
We also send out useful tips in a monthly email newsletter ...
Power BI Desktop updates for September 2025 Part three of a four-part series of blogs |
---|
The big changes in this month's update are two preview features which will change the working lives of DAX authors when released: a new way of creating calendars and the ability to write functions in DAX.
|
DAX has many built-in functions, but now you can add your own!
When testing this feature I encountered numerous bugs. You seem to have to enter all of the syntax on a single line, I got strange syntax errors despite my code being correct (and accepted) and I couldn't get creating functions in DAX query editor to work at all. It's good to know that DAX functions will be available soon, but I wouldn't enable them just yet.
Before you can create functions in DAX you first need to enable them from the File -> Options and settings -> Option dialog box:
The option to make DAX functions work (it requires a restart).
There are several ways to create functions in DAX, apparently, but I couldn't get DAX query view to work. So for now to create a function, switch to TMDL view:
The icon to switch to TMDL view.
Type in your function and apply your changes:
This pointless (and badly named) function doubles any number (see below for a more useful example of a function).
When I tried this in my version of Power BI Desktop I got this message:
Power BI uses an Analysis Services database behind the scenes, and it is this that needs updating - but why didn't this happen automatically as part of the monthly update?
When you click on Yes, you will then see your function as part of your semantic model:
You can expand Functions to see any DAX functions you've written.
Suppose you frequently want to calculate the value of a sale by multiplying the quantity of goods sold by the price. You might create this function in TDML view:
createOrReplace
/// a function to return the sales value as quantity multipled by price
function SalesValue = (Quantity : int64, Price : numeric) => Price * Quantity
So this function takes two arguments:
Argument | Data type | What it contains |
---|---|---|
Quantity | Integer | The number of items bought |
Price | Any number | The price of each |
The function then returns the price multiplied by the quantity. I could then use this in (for example) a measure:
The names of the two functions I've created appear in Intellisense.
Here for example is a final measure:
Total sales = SUMX(
Sales,
// take quantity * price
SalesValue(
Sales[Quantity],
Sales[Price]
)
)
I could then show this measure in a visual:
The measure above is showing total sales for each region.
The above example uses a simple scalar function, but DAX functions can also take tables as arguments. You can see much more details about creating DAX functions at this Microsoft blog, but Wise Owl will avoid using them until they are a bit smoother to use!
Parts of this blog |
---|
|
Some other pages relevant to the above blogs include:
Kingsmoor House
Railway Street
GLOSSOP
SK13 2AA
Landmark Offices
99 Bishopsgate
LONDON
EC2M 3XD
Holiday Inn
25 Aytoun Street
MANCHESTER
M1 3AE
© Wise Owl Business Solutions Ltd 2025. All Rights Reserved.