Forum Discussion
Avoiding filtered context with Variable. Help needed
- 5 years ago
danielboi , In the above I see one change , if that can work for you
VAR DateMax =
CALCULATE(
MAXX(
filter(allselected(FactFIRE),
FactFIRE[Version ID]=2),
FactFIRE[Period ID]
)
)
RETURN
danielboi , Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
You can easily get YTD like this for actual or budget
YTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESYTD('Date'[Date],"12/31"))
YTD till today =
var _min = date(year(today()),1,1)
var _max = eomonth(today(), 0)
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )
YTD till next month(may) =
var _min = date(year(today()),1,1)
var _max = eomonth(today(), 1)
return
CALCULATE(sum('order'[Qty]), FILTER(ALL('Date'),'Date'[Date] >= _min && 'Date'[Date] <=_max ) )