Forum Discussion
Peddabomma
8 years agoMicrosoft Employee
Current Fiscal Week Vs Last Year Fiscal Week
Hi All, I am trying to compare current fiscal week with last year same fiscal week . I cannot use sameperiodlastyear as my fiscalweek column is not a date column.
Help Appreciated.
Thanks,Raghu
Hi Peddabomma,
In this scenario, you may not be able to use the standard DAX time intelligence functions(i.e. sameperiodlastyear). However, you should be able to use some custom formulas like below to do calculations for Last Year Fiscal Week. :smileyhappy:
Last Year Fiscal Week Sales = VAR currentFiscalYear = MAX ( 'Table1'[Fiscal Year] ) VAR currentFiscalWeek = MAX ( 'Table1'[Fiscal Week] ) RETURN CALCULATE ( [Total Sales], FILTER ( ALL ( 'Table1' ), 'Table1'[Fiscal Year] = currentFiscalYear - 1 && 'Table1'[Fiscal Week] = currentFiscalWeek ) )Regards
2 Replies
- v-ljerr-msftMicrosoft Employee
Hi Peddabomma,
In this scenario, you may not be able to use the standard DAX time intelligence functions(i.e. sameperiodlastyear). However, you should be able to use some custom formulas like below to do calculations for Last Year Fiscal Week. :smileyhappy:
Last Year Fiscal Week Sales = VAR currentFiscalYear = MAX ( 'Table1'[Fiscal Year] ) VAR currentFiscalWeek = MAX ( 'Table1'[Fiscal Week] ) RETURN CALCULATE ( [Total Sales], FILTER ( ALL ( 'Table1' ), 'Table1'[Fiscal Year] = currentFiscalYear - 1 && 'Table1'[Fiscal Week] = currentFiscalWeek ) )Regards
- PeddabommaMicrosoft Employee
Thanks :smileyhappy: