Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (11.1k points)

How to create a Fiscal Year starts from 01-Jul-2015 to end at  30-Jun-2017

I have a code

Cal = 
ADDCOLUMNS (
   CALENDARAUTO ( 3 ),
   "MIndex", MONTH ( EDATE ( [Date], -3 ) ),
   "CalMonth", FORMAT ( [Date], "mmm" ),
   "CalQtr", "Q"
       & CEILING ( MONTH ( [Date] ), 3 ) / 3,
   "CalYear", YEAR ( [Date] ),
   "FinQtr", "Q"
       & CEILING ( MONTH ( EDATE ( [Date], -3 ) ), 3 ) / 3,
   "FY",
   VAR CY =
       RIGHT ( YEAR ( [Date] ), 2 )
   VAR NY =
       RIGHT ( YEAR ( [Date] ) + 1, 2 )
   VAR PY =
       RIGHT ( YEAR ( [Date] ) - 1, 2 )
   VAR FinYear =
       IF ( MONTH ( [Date] ) > 3, CY & "-" & NY, PY & "-" & CY )
   RETURN
       FinYear,
   "FinWeekNo", WEEKNUM ( EDATE ( [Date], -3 ), 2 ),
   "CalWeekNo", WEEKNUM ( [Date], 2 ),
   "Weekend/Working", IF ( WEEKDAY ( [Date], 2 ) > 5, "Weekend", "Working" ),
   "Day", FORMAT ( [Date], "ddd" ),
   "CustomDate", FORMAT ( [Date], "d/mm" )
)

How can I modify above code

 

1 Answer

0 votes
by (22.5k points)

Change 

CALENDARAUTO(3)
to
CALENDAR("2015-07-01", "2017-06-30")

If you want to learn more about Power BI, then read the Power BI Tutorial. Also, enroll in Power BI Training to become proficient in this BI tool.     

Related questions

0 votes
1 answer
0 votes
1 answer
asked Nov 4, 2020 in BI by Sudhir_1997 (55.6k points)
0 votes
1 answer
asked Dec 21, 2020 in BI by Chris (11.1k points)
0 votes
1 answer
asked Dec 1, 2020 in BI by Chris (11.1k points)
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...