Well – creating measures in the Power BI desktop is usually doing a lot of copying and pasting of measures.
And unfortunately, we haven’t yet gotten a Copy measure in the shortcut menu when we right click a measure
Here is an idea you can vote for if you would find it useful as well – https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13219620-duplicate-measure-and-format-copy
So we end up copying the formula from text in the formula bar
And click new measure and Paste it into the formula bar
But 8 of 10 times nothing is pasted (at least when I select) – WHY ???
And now I finally took me the time to find out why –
Notice the colour of the selection in the picture above compare to this
If the colour is darker blue you can copy and paste but if its lighter blue – you can’t – and this is properly because you use your mouse to select the formula and if you release the mouse outside of the formula bar area – the selection will be light blue and when you then press CTRL + C to copy the formula text isn’t copied to the clipboard.
Solution
So, either make sure you don’t move your pointer outside the area or use CTRL + A to select all and then press CTRL + C to copy the formula.
Hope this can save you a couple of clicks and please vote for the idea – https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/13219620-duplicate-measure-and-format-copy – this also includes the idea that the formatting of the value should be included.
Power On!
What I always do is just click on the line number in front. Also does the trick for a whole line 🙂
Great tip 👍 but only works when your DAX formula has one line
Pingback: Copying Measure Definitions in Power BI – Curated SQL
This selection/highlighting issue is a frustrating new feature of the last few builds of desktop. Hope this bug is explained or fixed soon.
Thanks Erik for this handy tip. What I usually do when I try to copy the formula and it becomes light blue, I just right click anywhere on the formula text (no matter how many lines it has). Doing this only select the whole text (makes it dark blue), then I use CTRL + C.
Thank you SO much.
Mistery solved !!!
Thank you for your explanation, this was driving me nuts for a very long time!!!