I have a matrix with portfolios as columns and portfolio total as values. I want to subtract each portfolio by a base portfolio. The below code returns the portfolio value in each column just fine. But when I try to hold the base portfolio constant I get the following error and the column returns nothing.
Relative Exposure =
VAR Portfolio =
SUMX(FILTER(Portfolio,Portfolio[VALUE]<>"#N/A"),[Weight] * Portfolio [VALUE])
VAR Base_Portfolio =
CALCULATE(SUMX(FILTER(ALLEXCEPT(Portfolio,Portfolio[Portfolio]),Portfolio[Portfolio]="Base_Portfolio" &&Portfolio[VALUE]<>"#N/A"),[Weight] * Portfolio[VALUE]))
RETURN Base_Portfolio - Portfolio
"A single value for column 'Portfolio' in table 'Portfolio' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."