Forum Discussion
viorelcazacu
5 years agoRegular Visitor
Error in creating Date value
Hello, I get an error when I want to create a date value with the DATE(Year, Month, Day) function. The function that gives error is this: DATE([MaxDateYear],[MaxDate],1) where MaxDate:=mo...
- 5 years ago
You cannot use measures in your filter like that. Use variables.
- 5 years ago
Hi viorelcazacu ,
Put the 2 variables in the formula,such as below:
SalesMTD CY = CALCULATE(SUM('Table'[Sales]),FILTER(ALL('Table'),'Table'[Fecha]>=DATE(YEAR(MAX('Table'[Fecha])),MONTH(MAX('Table'[Fecha])),1)&&'Table'[Fecha]<EOMONTH(MAX('Table'[Fecha]),0)))And you will see:
For the sample .pbix file,pls see attached.
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
lbendlin
5 years agoSuper User
You cannot use measures in your filter like that. Use variables.