Forum Discussion
JBell1979
4 years agoNew Member
Comparing sata sets from 2 years / 2 tables
Hello team. I am trying to compare data from different measures (say sales), so I have 2 tables 2022 and 2021. How can I compare these 2 figures to show a true comp figure? Thanks in advance for the...
- 4 years ago
Y'all rock. We got it covered many thanks for the replies!
amitchandak
Super User
4 years agoJBell1979 , Create a date/year table and join with both. Create other common dimension too
Try measures like
Table having 2022
This Year = CALCULATE(sum('Table1'[Value]), FILTER(ALL('Date'),h'Date'[Year Rank]=max('Date'[Year Rank])))
Table having 2021
Last Year = CALCULATE(sum('Table2'[Value]), FILTER(ALL('Date'),'Date'[Year Rank]=max('Date'[Year Rank])-1))
You need select 2022 or should have 2022 as max
This year Today =
CALCULATE(sum('Table1'[Qty]), FILTER('Date',year('Date'[Date] )= year(today()) ) )
Last year Today =
CALCULATE(sum('Table2'[Qty]), FILTER('Date',year('Date'[Date] )= year(today()) -1) )