Forum Discussion
Unknowncharact0
2 years agoRegular Visitor
Dynamic Fiscal Year
Hello, I am trying to create a dynamic count # of cases closed in a fiscal year (October to September) Current Fiscal Year Count = VAR CurrentDate = TODAY() VAR CurrentFiscalYear = IF(MONT...
- 2 years ago
is this what you want?
Count of Case for 2023 = VAR _year=CALCULATE(max('DIM Calendar'[Fiscal Year]),ALL('DIM Calendar'))-1 return CALCULATE(COUNT('Fact Table'[Case]), FILTER(all('DIM Calendar'),'DIM Calendar'[Fiscal Year]= _year)) Count of Case for 2024 = VAR _year=CALCULATE(max('DIM Calendar'[Fiscal Year]),ALL('DIM Calendar')) return CALCULATE(COUNT('Fact Table'[Case]), FILTER(all('DIM Calendar'),'DIM Calendar'[Fiscal Year]= _year))
Unknowncharact0
2 years agoRegular Visitor
https://1drv.ms/u/s!Anb0OMw34A1igQDHuXJI-0W4wixD?e=R5R5Bx
Thank you so much for your reply! See if this works for PBI sample, the idea is that I want to have a KPI card that will compare current year to previous year count and it rolls over automatically at the beginning of new year instead of me adjusting the measure.
ryan_mayu
Super User
2 years agois this what you want?
Count of Case for 2023 =
VAR _year=CALCULATE(max('DIM Calendar'[Fiscal Year]),ALL('DIM Calendar'))-1
return
CALCULATE(COUNT('Fact Table'[Case]),
FILTER(all('DIM Calendar'),'DIM Calendar'[Fiscal Year]= _year))
Count of Case for 2024 =
VAR _year=CALCULATE(max('DIM Calendar'[Fiscal Year]),ALL('DIM Calendar'))
return
CALCULATE(COUNT('Fact Table'[Case]),
FILTER(all('DIM Calendar'),'DIM Calendar'[Fiscal Year]= _year))