Forum Discussion
Line chart data comparison for year over year
Hi Everyone,I'm using the below measure as a date picker slicer. Now I need to show year-over-year (2021–2023) revenue in a line chart. If I select last week from the date picker slicer, then all three years of revenue should display in the visual with their last week data, for example, 2022 last week data and 2023 last week data comparison. I tried from the end but was unable to crack it. Can any one help me on this?
Here are the measueres which i wrote to comapre the revenue
Revenue Current Year = CALCULATE( SUM(RevenueBooked[Revenue]), FILTER( ALL('Date'), 'Date'[Date] >= MIN('Date'[Date]) && 'Date'[Date] <= MAX('Date'[Date]) ) )
Revenue PREVIOUSYEAR = CALCULATE( [Revenue Current Year], SAMEPERIODLASTYEAR('Date'[Date]) )
But Im getting the sale revenue for both years
1 Reply
- amitchandakSuper User
Anonymous , if you need based on today
This year Today =
var _min = eomonth(today(),-1*month(today()))+1
var _max = eomonth(_min,12 -1*month(today()) )
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))Last year Today =
var _max = eomonth(today(),-1*month(today()))
var _min = eomonth(_max,-12)+1
return
CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))I think for the current year use only
Revenue Current Year = SUM(RevenueBooked[Revenue])
Revenue PREVIOUSYEAR = CALCULATE( SUM(RevenueBooked[Revenue]), SAMEPERIODLASTYEAR('Date'[Date]) )