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
551 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 ...
Change multiple measure definitions at once |
---|
Updating a measure definition is easy but what happens when you have 200 to update? This blog guides you through using the Dax Query View to achieve this. |
There are times when a data source change may lead to many of your measure references becoming incorrect.
You can update them one by one or do a mass find and replace. To update a single measure is easy, click on the measure in the Data pane to see the DAX.
Highlight the old reference and overtype it with the new table and column name.
When you have multiple measures to update this can become a chore.
You have to edit each measure!
There is a much easier way to do this within the DAX Query View.
This is the 4th icon down on the left beneath your Model View.
On the right hand side you can see all your measures listed out under the Model tab.
You can also see your model's Tables and Relationships.
Right click on any measure and choose Quick queries | Define all measures in this model.
You can choose any Define option to see the selected measure's DAX.
The middle window now shows all the DAX for each measure, click Run to see the output of your measures.
Your measures will run by default without any filters on them.
Highlight the column reference you want to change and use Ctrl + H to display the find and replace options.
Enter the new column name and click the Replace All button, or press Ctrl + Alt + Enter
You can test your new code by clicking Run. When you're happy that it works, click Update model with changes to save the changes.
The number of changes are listed in brackets, here we have (3)
Switch back to Report view and click on your original measure to see the saved update.
All your measures will have their new definitions applied.
Beware you cannot use Ctrl + Z to undo any mistakes. Either perform another update or open a previously saved version of the report!
Some other pages relevant to the above blog 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 2024. All Rights Reserved.