Forum Discussion

chonchar's avatar
chonchar
Icon for Helper V rankHelper V
2 years ago
Solved

Custom Fiscal Year with DAX

parry2k Erokor 

Good morning,

 

I have a very large data set spanning 7 fiscal years. I currently have an area chart that visualizes "Total Screens" on the Y-axis and "Year" on the X-axis. See below: 

These "Screens" are currently grouped by the calendar year. 

 

I would like to create a custom fiscal year that runs from 10/1/2016 to 9/30/17, 10/1/2017-9/30/2018, etc. 

 

I would then like to put those custom years in place of the "Year" that is currently seen above.

 

How do you create a custom fiscal year with DAX? I would also like to name each year Contract Year 2017, Contract Year 2018, etc. 

 

Also, all of the data in this model is in a single table called "Appended Fiscals." The column name that hold the dates I want organized is called "Screened Date."

 

Any help would be appreicated. 

  • chonchar if it is of type date then try to change it to this to see if it works:

     

    Year = 
    VAR __Date = 'Table'[Date]
    VAR __Year = YEAR ( __Date ) 
    VAR __StartDate = DATE ( __Year, 10, 1 ) 
    VAR __EndDate = DATE ( __Year + 1, 9, 30 )
    RETURN
    
    IF  ( __Date >= __StartDate && __Date <= __EndDate, __Year + 1,  __Year )

14 Replies