Forum Discussion
sqldev2017
7 years agoMicrosoft Employee
Help with Simple DAX formula
I am doing something like this - PreviousMonth = FORMAT(CALCULATE(MIN(DimDate[Month]), FILTER(DimDate, DimDate[Month_Year] = [SelectedMonthYear]) ), "String") - Min(DimDate[Month]) ret...
- 7 years ago
Try storing the MEASURE value in a variable first
Revenue = VAR myMEASURE = [MonthYear] RETURN CALCULATE ( SUM ( fact[Revenue] ), FILTER ( fact, fact[fiscalMonth] = myMEASURE ) )
Zubair_Muhammad
7 years agoCommunity Champion
Try storing the MEASURE value in a variable first
Revenue =
VAR myMEASURE = [MonthYear]
RETURN
CALCULATE (
SUM ( fact[Revenue] ),
FILTER ( fact, fact[fiscalMonth] = myMEASURE )
)
sqldev2017
7 years agoMicrosoft Employee
That worked like a Charm.
Thank You.
Honestly, I was trying to do this FORMAT(Measure, "String") , that was not working.
This worked.