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!
Syndicate_Admin
Administrator
2 years agoAn ez solution I found is to split the column by the separator "/", now u have dd mm yyyy, after that u add all of them into a new column with this "Text.PadStart(Text.From([Day]), 2, "0") & "/" & Text.PadStart(Text.From([Month]), 2, "0") & "/" & Text.From([Year])", with this u can change it into date.