Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions Basic/Hide columns on the many side of a relationship.csx
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
17 changes: 17 additions & 0 deletions Intermediate/Replace Text Strings that appear in many measures.csx
Original file line number Diff line number Diff line change
@@ -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);
}