'Calendar table in power bi

I am trying to use calendar table for creating fiscal year

i tried this but this shows red mark under the dates

Calendar = ADDCOLUMNS(CALENDAR (DATE("1-Jul-2015"), DATE("30-Jun-2017")),
"Year",YEAR([Date]))


Solution 1:[1]

The DATE function takes three arguments, like this:

DATE(<year>, <month>, <day>)

So your table should be:

Calendar = ADDCOLUMNS(
  CALENDAR(
    DATE(2015, 7, 1),
    DATE(2017, 6, 30)
  ),
  "Year", YEAR([Date])
)

Here is the documentation: https://docs.microsoft.com/en-us/dax/date-function-dax

Solution 2:[2]

I would refer to a date than hard copy a date value. To cover all dates, it is better to use MIN and MAX of dates from your fact table and base your calendar on them: Here is a good video on this: https://www.youtube.com/watch?v=Oq5WOmo94_Q

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Casper Lehmann
Solution 2 Theo