Hi Gerardo,
If you’d like to calculate the count of “Donated Amounts” in each ranges of "$5 - $99", "$100 - $499" and etc., you may create a Calculated Element at cube level to show the ranges (e.g. $5 - $99) or range symbol (e.g. 1, 2 or etc.) for each row and then use Hierarchy Count Measure or Count Measure at metric set level :
Here is a sample script to create a “String” type calculated element to show the range of Amount donated. You may customize the following script and use it as the Expression of the Calculated element:
//Get Amounts donated
int tmpAmount = $DonatedAmount$;
//Decide what to display as the range
if (tmpAmount >1 && tmpAmount <=99) {
return "$5 - $99"; }
else if (tmpAmount <500 && tmpAmount >99){
return "$100 - $499"; }
else return "$500+";
Submit your changes and open “Data Preview” panel, scroll to the right, the new column should be displayed showing the ranges. Now, you can use Hierarchy Count Measure on your metric set to show the counts of donation received (in each range).
However, if you’d like to show numbers instead of string ranges, you may select the data type of the Calculated Element as “Int16” and return numbers in your script (e.g. return 1;) and finally use Count Measure on your metric set.