Forum Discussion
jblackshear
Advocate III
9 years agoProblem with date construction using DATE function
I have a need for year-to-date and previous year-to-date figures that always use the current date (actually, the maximum posting date available in the data warehouse, which is usually the previous bu...
- Anonymous9 years ago
Hi jblackshear,
>>Measures using a date that was created by programmatic manipulation of a real date cause an error, an error specifically referring to an invalid DATE value, when used in a chart (but no syntax errors in creating the measure).
"Date" function not available on mutiple date, power bi will show you the date function error "date too small or too large". So date function only works on single date calculate, if you want to filter on mutiple date, you can try to use SAMEPERIODLASTYEAR, DATEADD functions. (dateadd also works on your formula)
Regards,
Xiaoxin Sheng
Vvelarde
Community Champion
9 years ago
Hi, try using this:
Revenue YTD LY Current 4 = CALCULATE(SalesDataAggregated[Revenue YTD], DATESBETWEEN(Dates[Date], DATE(2016,1,1),[LatestPostingDateLY]))