Forum Discussion
DatesYTD inside a Calculate and Filter function, How?
- 1 year ago
I think i may have solved the issued by using the calculate inside another calculate function.
SelectedBalance YTD =
VAR CurrentItem = SELECTEDVALUE(IncomeStatement Dtls)
RETURN
SWITCH(
TRUE(),
CurrentItem = "Net Sales", [Net Sales YTD],
CurrentItem = "Cost of Sales", [Cost of Sales YTD],
CurrentItem = "Standard Margin", [Std Margin YTD],
CALCULATE(CALCULATE(
[Totals],
FILTER(
'Income Statement Dtls',
'Income Statement Dtls'[Category] = CurrentItem
)
),DATESYTD(Calender[Date]))
)
I think i may have solved the issued by using the calculate inside another calculate function.
SelectedBalance YTD =
VAR CurrentItem = SELECTEDVALUE(IncomeStatement Dtls)
RETURN
SWITCH(
TRUE(),
CurrentItem = "Net Sales", [Net Sales YTD],
CurrentItem = "Cost of Sales", [Cost of Sales YTD],
CurrentItem = "Standard Margin", [Std Margin YTD],
CALCULATE(CALCULATE(
[Totals],
FILTER(
'Income Statement Dtls',
'Income Statement Dtls'[Category] = CurrentItem
)
),DATESYTD(Calender[Date]))
)