Forum Discussion
Anonymous
4 years agoNot applicable
Creating a Measure using different filtered values from the same column
Hello all, I am pretty new to Power BI and am not very experienced in creating measures using DAX commands so I apologize if my terminology is a bit off. I am trying to create a measure that ...
- 4 years ago
Anonymous
Please try
= VAR Actual = CALCULATE ( SUM ( [Amount] ), [Scenario] = "Actual" ) VAR Budget = CALCULATE ( SUM ( [Amount] ), [Scenario] = "Budget" ) RETURN DIVIDE ( Actual - Budget, Actual )
tamerj1
4 years agoCommunity Champion
Anonymous
You ca use
CALCULATE (
SUM ( [Amount] ),
[Scenario] = "Actual"
) -
CALCULATE (
SUM ( [Amount] ),
[Scenario] = "Budget"
)
- Anonymous4 years agoNot applicable
Perfect this works thanks so much. What would I need to add to the code in order to get % variance? I tried adding the below code to the end but it said my syntax is wrong.
/ CALCULATE(SUM([Amount]),[Scenario] = "Actual")Thanks again- tamerj14 years agoCommunity Champion
Anonymous
Please try
= VAR Actual = CALCULATE ( SUM ( [Amount] ), [Scenario] = "Actual" ) VAR Budget = CALCULATE ( SUM ( [Amount] ), [Scenario] = "Budget" ) RETURN DIVIDE ( Actual - Budget, Actual )