Forum Discussion
Calculation with date table with previous date not working
- 2 years ago
pls try this
Net Value =
VAR previousYear = MAX(Dates[Year]) -1
RETURNCalculate(
SUM(Sales[NetValue]),FILTER(All(Dates),
Dates[Year] = previousYear)
)
or ------Net Value =
VAR previousYear = MAX(Dates[Year]) -1
RETURNCalculate(
SUM(Sales[NetValue]),FILTER(ALLSELECTED(Dates),
Dates[Year] = previousYear)
)
if you write it like this what do you get ?
Net Value =
VAR previousYear = MAX(Dates[Year]) -1
RETURN
previousYear
If I use that measure in a chart bar where the x-axis is the year, it returns properly the previous year for ech year
- Ahmedx2 years agoSuper User
pls try this
Net Value =
VAR previousYear = MAX(Dates[Year]) -1
RETURNCalculate(
SUM(Sales[NetValue]),FILTER(All(Dates),
Dates[Year] = previousYear)
)
or ------Net Value =
VAR previousYear = MAX(Dates[Year]) -1
RETURNCalculate(
SUM(Sales[NetValue]),FILTER(ALLSELECTED(Dates),
Dates[Year] = previousYear)
)