From 7817fd64a6bd4220db5da50b6022aad710fadd1d Mon Sep 17 00:00:00 2001 From: MattAlington <34114455+MattAlington@users.noreply.github.com> Date: Sat, 17 Oct 2020 11:33:13 +1100 Subject: [PATCH 1/2] Update Hide columns on the many side of a relationship.csx --- Basic/Hide columns on the many side of a relationship.csx | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Basic/Hide columns on the many side of a relationship.csx b/Basic/Hide columns on the many side of a relationship.csx index 8079b0f..8a80c30 100644 --- a/Basic/Hide columns on the many side of a relationship.csx +++ b/Basic/Hide columns on the many side of a relationship.csx @@ -6,6 +6,10 @@ * it is dangerous to use columns on the many side of a relationship as it can * produce unexpected results, so it is a best practice to hide these columns * to discourage their use in reports. + * + * This script does not play well with Auto Calendar Tables (because your Calendar Date + * column is technically on the many side of the hidden Auto Calendar Tables. + * Make sure you turn off Auto Calendar Tables first before using this script. */ // Hide all columns on many side of a join From 148841b371644a33dd44df873b4cd031729af0d0 Mon Sep 17 00:00:00 2001 From: MattAlington <34114455+MattAlington@users.noreply.github.com> Date: Sat, 17 Oct 2020 11:41:42 +1100 Subject: [PATCH 2/2] Add files via upload --- ...ext Strings that appear in many measures.csx | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) create mode 100644 Intermediate/Replace Text Strings that appear in many measures.csx diff --git a/Intermediate/Replace Text Strings that appear in many measures.csx b/Intermediate/Replace Text Strings that appear in many measures.csx new file mode 100644 index 0000000..f47fd0a --- /dev/null +++ b/Intermediate/Replace Text Strings that appear in many measures.csx @@ -0,0 +1,17 @@ +/* + * Title: Replace Text Strings that appear in many measures + * + * Author: Matt Allington http://xbi.com.au + * + * This script, when executed, will loop through the currently selected measures + * and replace the FromString with the ToString. + */ + +/ Replace Text Strings that appear in many measures + var FromString = "CALCULATE(SUM(Sales[ExtendedAmount])"; + var ToString = "CALCULATE([Total Sales]"; + foreach (var m in Model.AllMeasures) + { + m.Expression = m.Expression.Replace(FromString,ToString); + } +