Forum Discussion
Comparing previous and current year data on a line chart
- 9 years ago
Hi priyapalanki,
if you have 2 separate tables FY16 and FY17, it's easy now.
- Create Dates table for time pattern
Dates = CALENDARAUTO()
- Create Prev-Date Column
Prev - Date = DATEADD( Dates[Date],-1,YEAR)
- Union 2 separate tables FY16 -FY17 into 1 table:
u = UNION(FY16,FY17)
- Create 2 calculated measure to cumpute total amount of FY16 and FY17:
FY16 = CALCULATE(SUM(u[Amount]),FILTER(all(dates),Dates[Date]=MAX(Dates[Prev - Date]) ))
FY17 = CALCULATE(SUM(u[Amount]),FILTER(all(dates),[FY16]>0 && Dates[Date]=max(Dates[Date]) ))
My sample data and sample pbix file
If this works for you please accept it as solution and also like to give KUDOS.
Best regards
Tri Nguyen
Hi priyapalanki,
if you have 2 separate tables FY16 and FY17, it's easy now.
- Create Dates table for time pattern
Dates = CALENDARAUTO()
- Create Prev-Date Column
Prev - Date = DATEADD( Dates[Date],-1,YEAR)
- Union 2 separate tables FY16 -FY17 into 1 table:
u = UNION(FY16,FY17)
- Create 2 calculated measure to cumpute total amount of FY16 and FY17:
FY16 = CALCULATE(SUM(u[Amount]),FILTER(all(dates),Dates[Date]=MAX(Dates[Prev - Date]) ))
FY17 = CALCULATE(SUM(u[Amount]),FILTER(all(dates),[FY16]>0 && Dates[Date]=max(Dates[Date]) ))
My sample data and sample pbix file
If this works for you please accept it as solution and also like to give KUDOS.
Best regards
Tri Nguyen
tringuyenminh92 Thanks a lot for providing the solution . Would it be possible to see only the month on the axis ?
- tringuyenminh929 years agoMemorable Member
Hi priyapalanki,
As formula of 2 calcuated measure, it's computing by date level to show daily value in line chart, so far i could not make the X-Axis to show month level. It's so sorry to say that in this moment. :smileysad: