The introduction of the DAX query view (official blogpost) and the new INFO DAX functions (official blogpost) gives us some very possibilities to update our measures without using the formula bar.
We can for instance create a query that shows all the measures that has an error message like this
EVALUATE VAR _X =INFO.MEASURES() RETURN FILTER(_X, [ErrorMessage]<>"")
This will extract all my measures in the open power bi file that contains an error message.
In this case I have a measure that contains an error message telling me that I can’t use a True/False expression to filter a table. Normally you would probably search for the measure and the field list and modify via the formula bar but there is another way and will make it possible to test it before you update it.
Let me show you how 😀
The INFO.Measures() also returns the expression for the measure
Select the expression and press CTRL+C to copy the expression
As soon as you start to modify the expression of the measure the text “Update model: Overwriting measure” will appear
And if you want to test it before you hit the update model “button” – you can add an EVALUATE statement and see if the measure works as intended.
When you click to update – you will get a warning that tells you that there is no way to Undo it – so be sure 🙂
About the Author
Hey – I blog about Power BI and other elements in the Power Platform and do talks in the Community
References
Svensen, E. (2024). ‘#PowerBI – update your measures without the formula bar’, Available at: https://eriksvensen.wordpress.com/2024/03/06/powerbi-update-your-measures-without-the-formula-bar/ [Accessed: 29th March 2024].