Added new community scripts
Thanks for your contribution Matt.
Unfortunately, I can't approve the "Replace text strings that occur in many measures" script, since it is too specific. What if my model doesn't have a [Total Sales] measure? What if the original measure was formatted so there would be spaces or line breaks between CALCULATE and SUM? What about the many other possible table/column names that could also occur?
I recommend changing this to some kind of pattern matching. Preferably, use the Measure.Tokenize() function which would return a list of tokens for the DAX expression, making it easier to find a pattern containing the following tokens (in order), ignoring any whitespace, line breaks or comments:
- DaxToken.CALCULATE
- DaxToken.OPEN_PARENS
- DaxToken.SUM
- DaxToken.OPEN_PARENS
- DaxToken.COLUMN_OR_MEASURE
- DaxToken.CLOSE_PARENS
You can use the same pattern matching technique to build an index of all existing measures, to check whether a suitable measure could be replaced, or if a new measure has to be created.
I copied this repo and added your file to the following Repo: https://github.com/PowerBI-tips/TabularEditor-Scripts/blob/main/Basic/Create%20Build%20direct%20or%20indirect%20dependency%20tree%20of%20selected%20or%20all%20measures.csx
You are welcome to continue to contribute to this repo as I am actively maintaining the Tabular Editor scripts there: https://github.com/PowerBI-tips/TabularEditor-Scripts