I found this solution from here https://community.fabric.microsoft.com/t5/Desktop/Creating-a-slicer-to-toggle-between-Fiscal-and-Calendar-year-and/m-p/1690747#M672232
Switch Calendar = var startmonth = 7 return union( ADDCOLUMNS( SUMMARIZE('Dim Date','Dim Date '[Day Date]), "Year", if(month([Day Date])<startmonth,date(year([Day Date]),1,1),date(year([Day Date])+1,1,1)), "Calendar", "Financial" ) , ADDCOLUMNS( SUMMARIZE('Dim Date','Dim Date'[Day Date]), "Year", date(year([Day Date]),1,1), "Calendar", "Calendar" ))