Forum Discussion

JBell1979's avatar
JBell1979
New Member
4 years ago
Solved

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 help

Jeff

3 Replies

  • Y'all rock. We got it covered many thanks for the replies!

  • JBell1979 , 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) )

  • v-kkf-msft's avatar
    v-kkf-msft
    Icon for Community Support rankCommunity Support

    Hi JBell1979 ,

     

    I am not sure if I understood your question correctly. If you want to compare the sales per month, you can create a Dates table and create the relationship. Then use the [Date.Month], [2021 Sales] and [2022 Sales] in matrix chart. 

     

     

    If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
    Best Regards,
    Winniz
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.