Forum Discussion
daniel1983
4 years agoFrequent Visitor
Help - % Change Between Fiscal Years
Hi - I'm struggling with this and hope someon can assist! A sample of my data is below. For a number of companies I have sales data for each fiscal year. The fiscal years are not calendar years (...
- 4 years ago
you can create a column
Column = VAR _last=maxx(FILTER('Table','Table'[Company]=EARLIER('Table'[Company])&&'Table'[FY]=EARLIER('Table'[FY])-1),'Table'[Sales]) RETURN if(ISBLANK(_last),BLANK(),'Table'[Sales]/_last-1)or create a measure
Measure = VAR _last=SUMX(FILTER(all('Table'),'Table'[Company]=max('Table'[Company])&&'Table'[FY]=max('Table'[FY])-1),'Table'[Sales]) return if(ISBLANK(_last),BLANK(), sum('Table'[Sales])/_last-1)pls see the attachment below
- 4 years ago
pls see the attachment below
- 4 years ago
pls try this
Measure = VAR _last=SUMX(FILTER(all('Table'),'Table'[Company]=max('Table'[Company])&&'Table'[FY]=MAX('Table'[FY])-1),'Table'[Sales]) VAR _last2=SUMX(FILTER(all('Table'),'Table'[FY]=MAX('Table'[FY])-1),'Table'[Sales]) return if(HASONEVALUE('Table'[Company]), if(ISBLANK(_last),BLANK(), sum('Table'[Sales])/_last-1),if(ISBLANK(_last2),BLANK(), sum('Table'[Sales])/_last2-1)) - 4 years agoMeasure =VAR _max=max('Table'[Fiscal year2])VAR _last=_max-1return DIVIDE(CALCULATE(sum('Table'[Sales]),'Table'[Fiscal year2]=_max),CALCULATE(sum('Table'[Sales]),'Table'[Fiscal year2]=_last))-1
ryan_mayu
4 years agoSuper User
pls try this
Measure =
VAR _last=SUMX(FILTER(all('Table'),'Table'[Company]=max('Table'[Company])&&'Table'[FY]=MAX('Table'[FY])-1),'Table'[Sales])
VAR _last2=SUMX(FILTER(all('Table'),'Table'[FY]=MAX('Table'[FY])-1),'Table'[Sales])
return if(HASONEVALUE('Table'[Company]), if(ISBLANK(_last),BLANK(), sum('Table'[Sales])/_last-1),if(ISBLANK(_last2),BLANK(), sum('Table'[Sales])/_last2-1))
daniel1983
4 years agoFrequent Visitor
Thanks ryan_mayu - this works! Sorry to keep coming back to you, but this is slightly beyond my abilities 🙂 One more variation I am trying. Say there is a company 'C', and I'd like to select a subset of companies (e.g., A and C) and calculate the percentage increase in sales for those companies only. Is it possible to define a third varaible (_last3) and then update the return if statement to account for situations where you are only pulling a subset of companies?