Creating measures with the CALCULATE function
In the previous section, we created measures that gave us counts for each of the colors for our items. We will be using the CALCUATE
function to create formulas that return the percentage of a color versus the total of colored items in the model. To do this, we will need to eliminate those items whose color is N/A
. We will use the CALCULATE
function to do this.
The CALCULATE
function allows us to add filters to the calculation we are trying to work with. CALCULATE
does not allow the use of a measure in its expression. It also returns a single value. The filters for this function need to return a table, so the work we did with our item filter in the count calculations will need to be handled as a table filter. The other important note here is that the CALCULATE
function's filters override other filters that may be applied by external operations in visualization tools. The calculation will be performed over the tables as specified...