Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
JBell1979
New 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 help

Jeff

1 ACCEPTED SOLUTION
JBell1979
New Member

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

View solution in original post

3 REPLIES 3
JBell1979
New Member

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

v-kkf-msft
Community Support
Community 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. 

 

vkkfmsft_0-1646372601952.png

Screenshot 2022-03-04 134452.png

 

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.

 

amitchandak
Super User
Super User

@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) )

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.